extmod/moduselect: Conditionally compile select().

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>
This commit is contained in:
David Lechner
2021-07-06 18:08:18 -05:00
committed by Damien George
parent 8be29b9b1b
commit 8758504f0f
2 changed files with 11 additions and 0 deletions

View File

@@ -1316,6 +1316,13 @@ typedef double mp_float_t;
#define MICROPY_PY_USELECT (0)
#endif
// Whether to enable the select() function in the "uselect" module (baremetal
// implementation). This is present for compatibility but can be disabled to
// save space.
#ifndef MICROPY_PY_USELECT_SELECT
#define MICROPY_PY_USELECT_SELECT (1)
#endif
// Whether to provide "utime" module functions implementation
// in terms of mp_hal_* functions.
#ifndef MICROPY_PY_UTIME_MP_HAL