diff --git a/atmel-samd/mpconfigport.h b/atmel-samd/mpconfigport.h index 20c2c5f4d9..0e4e0bcf27 100644 --- a/atmel-samd/mpconfigport.h +++ b/atmel-samd/mpconfigport.h @@ -128,8 +128,10 @@ extern const struct _mp_obj_module_t uheap_module; { MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_uos), (mp_obj_t)&uos_module }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module } \ + { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module } + +#define MICROPY_PORT_BUILTIN_DEBUG_MODULES \ + { MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module } // board specific definitions #include "mpconfigboard.h" diff --git a/py/objmodule.c b/py/objmodule.c index 7ed3175c0d..48e373b844 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -219,6 +219,10 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = { // extra builtin modules as defined by a port MICROPY_PORT_BUILTIN_MODULES + +#if defined(DEBUG) && defined(MICROPY_PORT_BUILTIN_DEBUG_MODULES) + , MICROPY_PORT_BUILTIN_DEBUG_MODULES +#endif }; STATIC MP_DEFINE_CONST_MAP(mp_builtin_module_map, mp_builtin_module_table);