We've got a custom board that we want to run Micropython on, but my lead developer wants it to be our board name, not pyb, for the name of the module.
He previously just downloaded the code and did a global search-and-replace but that makes it much harder to upgrade releases. I'm making a forked Git project with the changes for our board and want to try to keep the divergence minimal.
Is there a simple way to change the module name or to alias the module name?
Renaming the pyb module?
Re: Renaming the pyb module?
You can get away with changing a single line.
Namely this one:
https://github.com/micropython/micropyt ... ort.h#L188
change MP_QSTR_pyb to be MP_QSTR_myboardname
and rebuild (you may need to do a clean and rebuild).
Namely this one:
https://github.com/micropython/micropyt ... ort.h#L188
change MP_QSTR_pyb to be MP_QSTR_myboardname
and rebuild (you may need to do a clean and rebuild).
Re: Renaming the pyb module?
Thanks David:
I found that one and that helped with the import.
My lead wasn't happy that the help(boardname) command still said __name__ = pyb so I found the MP_ROM_QSTR(MP_QSTR_pyb) in modpyb.c pyb_module_globals_table{}
Once I changed those two it seems to work well.
Luciano
I found that one and that helped with the import.
My lead wasn't happy that the help(boardname) command still said __name__ = pyb so I found the MP_ROM_QSTR(MP_QSTR_pyb) in modpyb.c pyb_module_globals_table{}
Once I changed those two it seems to work well.
Luciano