py/modmicropython: Make module optional.
This module is useful, but it is not always needed. Disabling it saves several kilobytes of build size, depending on other config options. Signed-off-by: Laurens Valk <laurens@pybricks.com>
This commit is contained in:
committed by
Damien George
parent
fb7d211530
commit
f724d90e6c
@@ -32,6 +32,8 @@
|
|||||||
#include "py/gc.h"
|
#include "py/gc.h"
|
||||||
#include "py/mphal.h"
|
#include "py/mphal.h"
|
||||||
|
|
||||||
|
#if MICROPY_PY_MICROPYTHON
|
||||||
|
|
||||||
// Various builtins specific to MicroPython runtime,
|
// Various builtins specific to MicroPython runtime,
|
||||||
// living in micropython module
|
// living in micropython module
|
||||||
|
|
||||||
@@ -211,3 +213,5 @@ const mp_obj_module_t mp_module_micropython = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
MP_REGISTER_MODULE(MP_QSTR_micropython, mp_module_micropython);
|
MP_REGISTER_MODULE(MP_QSTR_micropython, mp_module_micropython);
|
||||||
|
|
||||||
|
#endif // MICROPY_PY_MICROPYTHON
|
||||||
|
|||||||
@@ -1311,6 +1311,11 @@ typedef double mp_float_t;
|
|||||||
#define MICROPY_PY_CMATH (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
|
#define MICROPY_PY_CMATH (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Whether to provide "micropython" module
|
||||||
|
#ifndef MICROPY_PY_MICROPYTHON
|
||||||
|
#define MICROPY_PY_MICROPYTHON (1)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Whether to provide "gc" module
|
// Whether to provide "gc" module
|
||||||
#ifndef MICROPY_PY_GC
|
#ifndef MICROPY_PY_GC
|
||||||
#define MICROPY_PY_GC (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
|
#define MICROPY_PY_GC (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES)
|
||||||
|
|||||||
Reference in New Issue
Block a user