py: Allow registration of modules at their definition.

During make, makemoduledefs.py parses the current builds c files for
MP_REGISTER_MODULE(module_name, obj_module, enabled_define)

These are used to generate a header with the required entries for
"mp_rom_map_elem_t mp_builtin_module_table[]" in py/objmodule.c
This commit is contained in:
Andrew Leech
2019-02-18 14:58:44 +11:00
committed by Damien George
parent e4ac104b7f
commit cf22f4793c
6 changed files with 143 additions and 4 deletions

View File

@@ -40,4 +40,6 @@ const mp_obj_module_t mp_module_array = {
.globals = (mp_obj_dict_t*)&mp_module_array_globals,
};
MP_REGISTER_MODULE(MP_QSTR_array, mp_module_array, MICROPY_PY_ARRAY);
#endif