summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/moduselect.c
Commit message (Collapse)AuthorAge
* all: Rename *umodule*.c to remove the "u" prefix.Jim Mussared2023-06-08
| | | | | | | | | | | Updates any includes, and references from Makefiles/CMake. This essentially reverts what was done long ago in commit 136b5cbd7669e8318f8455fc2706da97a5b7994c This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Rename UMODULE to MODULE in preprocessor/Makefile vars.Jim Mussared2023-06-08
| | | | | | This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Rename mp_umodule*, mp_module_umodule* to remove the "u" prefix.Jim Mussared2023-06-08
| | | | | | This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Rename MP_QSTR_umodule to MP_QSTR_module everywhere.Jim Mussared2023-06-08
| | | | | | | | | This renames the builtin-modules, such that help('modules') and printing the module object will show "module" rather than "umodule". This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* py/obj: Convert make_new into a mp_obj_type_t slot.Jim Mussared2022-09-19
| | | | | | | | | | | Instead of being an explicit field, it's now a slot like all the other methods. This is a marginal code size improvement because most types have a make_new (100/138 on PYBV11), however it improves consistency in how types are declared, removing the special case for make_new. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* py/obj: Merge getiter and iternext mp_obj_type_t slots.Jim Mussared2022-09-19
| | | | | | | | | | | | | | | | | | | | | | The goal here is to remove a slot (making way to turn make_new into a slot) as well as reduce code size by the ~40 references to mp_identity_getiter and mp_stream_unbuffered_iter. This introduces two new type flags: - MP_TYPE_FLAG_ITER_IS_ITERNEXT: This means that the "iter" slot in the type is "iternext", and should use the identity getiter. - MP_TYPE_FLAG_ITER_IS_CUSTOM: This means that the "iter" slot is a pointer to a mp_getiter_iternext_custom_t instance, which then defines both getiter and iternext. And a third flag that is the OR of both, MP_TYPE_FLAG_ITER_IS_STREAM: This means that the type should use the identity getiter, and mp_stream_unbuffered_iter as iternext. Finally, MP_TYPE_FLAG_ITER_IS_GETITER is defined as a no-op flag to give the default case where "iter" is "getiter". Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Remove unnecessary locals_dict cast.Jim Mussared2022-09-19
| | | | Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.Jim Mussared2022-09-19
| | | | | | In preparation for upcoming rework of mp_obj_type_t layout. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Remove third argument to MP_REGISTER_MODULE.Damien George2022-06-02
| | | | | | | | It's no longer needed because this macro is now processed after preprocessing the source code via cpp (in the qstr extraction stage), which means unused MP_REGISTER_MODULE's are filtered out by the preprocessor. Signed-off-by: Damien George <damien@micropython.org>
* extmod: Make extmod modules use MP_REGISTER_MODULE.Jim Mussared2022-05-18
| | | | Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Use mp_obj_malloc everywhere it's applicable.Jim Mussared2022-05-03
| | | | | | | | | | | | | | | This replaces occurences of foo_t *foo = m_new_obj(foo_t); foo->base.type = &foo_type; with foo_t *foo = mp_obj_malloc(foo_t, &foo_type); Excludes any places where base is a sub-field or when new0/memset is used. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* extmod/moduselect: Conditionally compile select().David Lechner2021-07-17
| | | | | | | | | This adds #if MICROPY_PY_USELECT_SELECT around the uselect.select() function. According to the docs, this function is only for CPython compatibility and should not normally be used. So we can disable it and save a few bytes of flash space where possible. Signed-off-by: David Lechner <david@pybricks.com>
* extmod: Remove old comments used for auto-doc generation.Damien George2021-05-06
| | | | | | They are no longer used, and the text in the docs is more up to date. Signed-off-by: Damien George <damien@micropython.org>
* extmod/moduselect: Fix unsigned/signed comparison for timeout!=-1.Jim Mussared2021-02-16
| | | | Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* all: Fix implicit floating point promotion.stijn2020-04-18
| | | | | | | | | | | | | Initially some of these were found building the unix coverage variant on MacOS because that build uses clang and has -Wdouble-promotion enabled, and clang performs more vigorous promotion checks than gcc. Additionally the codebase has been compiled with clang and msvc (the latter with warning level 3), and with MICROPY_FLOAT_IMPL_FLOAT to find the rest of the conversions. Fixes are implemented either as explicit casts, or by using the correct type, or by using one of the utility functions to handle floating point casting; these have been moved from nativeglue.c to the public API.
* all: Reformat C and Python source code with tools/codeformat.py.Damien George2020-02-28
| | | | This is run with uncrustify 0.70.1, and black 19.10b0.
* various: Add and update my copyright line based on git history.Paul Sokolovsky2019-05-17
| | | | For modules I initially created or made substantial contributions to.
* extmod/moduselect: Adjust select_select and poll_register to use size_t.Wolf Vollprecht2019-03-13
|
* extmod: Convert legacy uppercase macro names to lowercase.Damien George2019-02-12
|
* extmod: Fix to support compiling with object representation D.Damien George2018-07-08
|
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* extmod: Use MP_ROM_INT for int values in an mp_rom_map_elem_t.Damien George2017-07-31
|
* extmod/moduselect: Implement ipoll() method for alloc-free polling.Paul Sokolovsky2017-04-29
| | | | Similar to the implementation added to unix port module previously.
* extmod/moduselect: Refactor towards introduction of poll.ipoll().Paul Sokolovsky2017-04-29
| | | | This follows previous refactor made to unix/moduselect.
* extmod/moduselect: Convert to MP_ROM_QSTR and friends.Paul Sokolovsky2017-04-29
|
* extmod/moduselect: Update to use size_t for array accessor.Damien George2017-03-29
|
* extmod/moduselect: Use configurable EVENT_POLL_HOOK instead of WFI.Damien George2016-12-02
| | | | To make moduselect be usable by any port.
* extmod/moduselect: Use stream helper function instead of ad-hoc code.Damien George2016-12-02
|
* py/stream: Move ad-hoc ioctl constants to stream.h and rename them.Damien George2016-12-02
| | | | | | | | The constants MP_IOCTL_POLL_xxx, which were stmhal-specific, are moved from stmhal/pybioctl.h (now deleted) to py/stream.h. And they are renamed to MP_STREAM_POLL_xxx to be consistent with other such constants. All uses of these constants have been updated.
* extmod/moduselect: Fix comment describing endif.Damien George2016-11-21
|
* stmhal/moduselect: Move to extmod/ for reuse by other ports.Paul Sokolovsky2016-11-21