A complete noob here. So be gentle please.
I have seen two variations of the global table in c modules implemented as:
Code: Select all
STATIC const mp_rom_map_elem_t esp_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_mymodule) },
};
or
Code: Select all
STATIC const mp_map_elem_t global_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_mymodule) },
};
I have tried to search in code-base; and both seem to be equally used. I am guessing one would be used to freeze the table in flash and the other in RAM; but I haven't seen anything to confirm that assumption. What are the circumstances where I choose one over the other ? Is this documented somewhere ?