From 260568e081a56488f122db41065e0059ca89c306 Mon Sep 17 00:00:00 2001 From: Rick Sorensen Date: Sun, 9 Jun 2024 21:34:01 -0500 Subject: [PATCH] samd/mcu/samd21: Allow user to enable additional options. Currently for samd21 some features are disable because of limited memory. With the ability to trade firmware and filesystem space, a user may wish to selectively enable some of these features. This change allows them to be enabled in board `mpconfigboard.h` or on the build command line for example. The selectively enable functions are: MICROPY_PY_FRAMEBUF, MICROPY_PY_SELECT, MICROPY_PY_ONEWIRE and MICROPY_PY_ASYNCIO. Signed-off-by: Rick Sorensen --- ports/samd/mcu/samd21/mpconfigmcu.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ports/samd/mcu/samd21/mpconfigmcu.h b/ports/samd/mcu/samd21/mpconfigmcu.h index fdad3fee4a..fbb5b28e2b 100644 --- a/ports/samd/mcu/samd21/mpconfigmcu.h +++ b/ports/samd/mcu/samd21/mpconfigmcu.h @@ -63,12 +63,20 @@ unsigned long trng_random_u32(int delay); #define MICROPY_PY_BUILTINS_ROUND_INT (SAMD21_EXTRA_FEATURES) #define MICROPY_CAN_OVERRIDE_BUILTINS (SAMD21_EXTRA_FEATURES) #define MICROPY_PY_SYS_STDIO_BUFFER (SAMD21_EXTRA_FEATURES) +#ifndef MICROPY_PY_FRAMEBUF #define MICROPY_PY_FRAMEBUF (SAMD21_EXTRA_FEATURES) +#endif +#ifndef MICROPY_PY_ASYNCIO #define MICROPY_PY_ASYNCIO (SAMD21_EXTRA_FEATURES) +#endif +#ifndef MICROPY_PY_SELECT #define MICROPY_PY_SELECT (SAMD21_EXTRA_FEATURES) +#endif #define MICROPY_PY_ERRNO (SAMD21_EXTRA_FEATURES) #define MICROPY_PY_DEFLATE (SAMD21_EXTRA_FEATURES) +#ifndef MICROPY_PY_ONEWIRE #define MICROPY_PY_ONEWIRE (SAMD21_EXTRA_FEATURES) +#endif #ifndef MICROPY_PY_MACHINE_PIN_BOARD_CPU #define MICROPY_PY_MACHINE_PIN_BOARD_CPU (1)