diff options
Diffstat (limited to 'zephyr/mpconfigport.h')
-rw-r--r-- | zephyr/mpconfigport.h | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/zephyr/mpconfigport.h b/zephyr/mpconfigport.h index 1654e79b8c..e291faf1d6 100644 --- a/zephyr/mpconfigport.h +++ b/zephyr/mpconfigport.h @@ -28,10 +28,10 @@ // Include Zephyr's autoconf.h, which should be made first by Zephyr makefiles #include "autoconf.h" -// Saving extra crumbs to make sure binary fits in 128K -#define MICROPY_COMP_CONST_FOLDING (0) -#define MICROPY_COMP_CONST (0) -#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0) +// Usually passed from Makefile +#ifndef MICROPY_HEAP_SIZE +#define MICROPY_HEAP_SIZE (16 * 1024) +#endif #define MICROPY_STACK_CHECK (1) #define MICROPY_ENABLE_GC (1) @@ -53,13 +53,33 @@ #define MICROPY_PY_CMATH (0) #define MICROPY_PY_IO (0) #define MICROPY_PY_MICROPYTHON_MEM_INFO (1) +#define MICROPY_PY_MACHINE (1) +#define MICROPY_MODULE_WEAK_LINKS (1) #define MICROPY_PY_STRUCT (0) +#define MICROPY_PY_UTIME (1) +#define MICROPY_PY_UTIME_MP_HAL (1) #define MICROPY_PY_SYS_MODULES (0) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_LONGLONG) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_PY_BUILTINS_COMPLEX (0) + +// Saving extra crumbs to make sure binary fits in 128K +#define MICROPY_COMP_CONST_FOLDING (0) +#define MICROPY_COMP_CONST (0) +#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (0) + +#ifdef CONFIG_BOARD +#define MICROPY_HW_BOARD_NAME "zephyr-" CONFIG_BOARD +#else #define MICROPY_HW_BOARD_NAME "zephyr-generic" +#endif + +#ifdef CONFIG_SOC +#define MICROPY_HW_MCU_NAME CONFIG_SOC +#else #define MICROPY_HW_MCU_NAME "unknown-cpu" +#endif + #define MICROPY_MODULE_FROZEN_STR (1) typedef int mp_int_t; // must be pointer size @@ -77,6 +97,22 @@ typedef long mp_off_t; mp_obj_t mp_kbd_exception; \ const char *readline_hist[8]; +extern const struct _mp_obj_module_t mp_module_machine; +extern const struct _mp_obj_module_t mp_module_time; + +#if MICROPY_PY_UTIME +#define MICROPY_PY_UTIME_DEF { MP_ROM_QSTR(MP_QSTR_utime), MP_ROM_PTR(&mp_module_time) }, +#else +#define MICROPY_PY_UTIME_DEF +#endif + +#define MICROPY_PORT_BUILTIN_MODULES \ + { MP_OBJ_NEW_QSTR(MP_QSTR_machine), (mp_obj_t)&mp_module_machine }, \ + MICROPY_PY_UTIME_DEF \ + +#define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ + { MP_OBJ_NEW_QSTR(MP_QSTR_time), MP_ROM_PTR(&mp_module_time) }, \ + // extra built in names to add to the global namespace #define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ |