update
I am still working on the module integration - got one answers to my help issue on github repo from loboris
-
Add a define NEW_MODULE to menuconfig (MicroPython_BUILD/components/micropython/Kconfig.projbuild)
-
Add a ifdef guard with your DEFINE NEW_MODULE to the micropython makefile ( MicroPython_BUILD/components/micropython/component.mk)
-
write your sourcecode (MicroPython_BUILD/components/micropython/esp32/new_module.c)
Kconfig.projbuild
config MICROPY_USE_NEW_MODULE
bool "Use NEW_MODULE "
default y
help
Include source from new_model.c into build
ifdef MICROPY_USE_NEW_MODULE
SRC_C += esp32/new_module.c
endif
mpconfigport.h
#ifdef MICROPY_USE_NEW_MODULE
extern const struct _mp_obj_module_t mp_module_new_module;
#define BUILTIN_MODULE_NEW_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_indicator), (mp_obj_t)&mp_module_new_module},
#else
#define BUILTIN_MODULE_NEW_MODULE
#endif
...
#define MICROPY_PORT_BUILTIN_MODULES \
...
BUILTIN_MODULE_NEW_MODULE \