Commit 22cf0940 authored by stijn's avatar stijn Committed by Damien George

py/modbuiltins: Add additional macro for extending builtins.

Mainly useful for defining additional globals in boards and variants.
parent df3f59ca
......@@ -775,6 +775,7 @@ STATIC const mp_rom_map_elem_t mp_module_builtins_globals_table[] = {
// Extra builtins as defined by a port
MICROPY_PORT_BUILTINS
MICROPY_PORT_EXTRA_BUILTINS
};
MP_DEFINE_CONST_DICT(mp_module_builtins_globals, mp_module_builtins_globals_table);
......
......@@ -1581,6 +1581,12 @@ typedef double mp_float_t;
#define MICROPY_PORT_BUILTINS
#endif
// Additional builtin function definitions for extension by command-line, boards or variants.
// See modbuiltins.c:mp_module_builtins_globals_table for format.
#ifndef MICROPY_PORT_EXTRA_BUILTINS
#define MICROPY_PORT_EXTRA_BUILTINS
#endif
// Additional builtin module definitions - see objmodule.c:mp_builtin_module_table for format.
#ifndef MICROPY_PORT_BUILTIN_MODULES
#define MICROPY_PORT_BUILTIN_MODULES
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment