aboutsummaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2021-07-06 18:08:18 -0500
committerDamien George <damien@micropython.org>2021-07-17 23:32:39 +1000
commit8758504f0f1c300ec2bc40f4e3b9627c8e8562dd (patch)
treefe6a012a700997a406e31536ff80650e088763af /py/mpconfig.h
parent8be29b9b1b0fc2709d6ace3a9ff32092052359f6 (diff)
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>
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 48c4c6d34..f67e11cd4 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -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