Post
by dhylands » Tue Mar 28, 2017 3:53 am
MICROPY_PORT_BUILTIN_MODULES is used to define builtin modules. modules included in this will be located when you do import module_name.
MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS is used to define weak links. In the stmhal port, for example weak links ubinascii to binascii. This allows 2 things. 1 - You can use import binascii and if there is no binascii module otherwise then it will import ubinascii instead. 2 - The u modules are micro-modules and don't include the full functionality of a module. Often times, the missing functionality can be implemented in python. By using weak links, it allows a python module names binascii to be implemented, this overriding the weak-link.
MICROPY_PORT_CONSTANTS defines constants that the parser will substitute with the real object.
So all 3 serve very distinct purposes.