From ad7b98c8290ba5f4235fe0cd8fbf542e5bcace54 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 23 Jun 2022 12:58:11 +1000 Subject: [PATCH] esp8266/mpconfigport: Switch to ROM feature level configuration. This is a no-op in terms of board configuration. Signed-off-by: Damien George --- ports/esp8266/boards/GENERIC/mpconfigboard.h | 8 -- .../esp8266/boards/GENERIC_1M/mpconfigboard.h | 8 +- .../boards/GENERIC_512K/mpconfigboard.h | 8 ++ ports/esp8266/mpconfigport.h | 75 +++++++++---------- 4 files changed, 46 insertions(+), 53 deletions(-) diff --git a/ports/esp8266/boards/GENERIC/mpconfigboard.h b/ports/esp8266/boards/GENERIC/mpconfigboard.h index e4991ba970..1d9b8e6f70 100644 --- a/ports/esp8266/boards/GENERIC/mpconfigboard.h +++ b/ports/esp8266/boards/GENERIC/mpconfigboard.h @@ -11,12 +11,4 @@ #define MICROPY_READER_VFS (MICROPY_VFS) #define MICROPY_VFS (1) -#define MICROPY_PY_FSTRINGS (1) -#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1) -#define MICROPY_PY_ALL_SPECIAL_METHODS (1) -#define MICROPY_PY_IO_FILEIO (1) -#define MICROPY_PY_SYS_STDIO_BUFFER (1) -#define MICROPY_PY_UASYNCIO (1) -#define MICROPY_PY_URE_SUB (1) #define MICROPY_PY_UCRYPTOLIB (1) -#define MICROPY_PY_FRAMEBUF (1) diff --git a/ports/esp8266/boards/GENERIC_1M/mpconfigboard.h b/ports/esp8266/boards/GENERIC_1M/mpconfigboard.h index ed50729936..10e8adcda7 100644 --- a/ports/esp8266/boards/GENERIC_1M/mpconfigboard.h +++ b/ports/esp8266/boards/GENERIC_1M/mpconfigboard.h @@ -11,10 +11,6 @@ #define MICROPY_READER_VFS (MICROPY_VFS) #define MICROPY_VFS (1) -#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1) -#define MICROPY_PY_ALL_SPECIAL_METHODS (1) -#define MICROPY_PY_IO_FILEIO (1) -#define MICROPY_PY_SYS_STDIO_BUFFER (1) -#define MICROPY_PY_URE_SUB (1) +#define MICROPY_PY_FSTRINGS (0) +#define MICROPY_PY_UASYNCIO (0) #define MICROPY_PY_UCRYPTOLIB (1) -#define MICROPY_PY_FRAMEBUF (1) diff --git a/ports/esp8266/boards/GENERIC_512K/mpconfigboard.h b/ports/esp8266/boards/GENERIC_512K/mpconfigboard.h index 0693232aa1..ef37e22fb6 100644 --- a/ports/esp8266/boards/GENERIC_512K/mpconfigboard.h +++ b/ports/esp8266/boards/GENERIC_512K/mpconfigboard.h @@ -2,3 +2,11 @@ #define MICROPY_HW_MCU_NAME "ESP8266" #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE) + +#define MICROPY_PY_FSTRINGS (0) +#define MICROPY_PY_BUILTINS_SLICE_ATTRS (0) +#define MICROPY_PY_ALL_SPECIAL_METHODS (0) +#define MICROPY_PY_SYS_STDIO_BUFFER (0) +#define MICROPY_PY_UASYNCIO (0) +#define MICROPY_PY_URE_SUB (0) +#define MICROPY_PY_FRAMEBUF (0) diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h index 583d3648af..365327aa4c 100644 --- a/ports/esp8266/mpconfigport.h +++ b/ports/esp8266/mpconfigport.h @@ -6,6 +6,42 @@ #include +// Set the rom feature level. +#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES) + +// Disable items from the extra level that are not wanted. +#define MICROPY_COMP_MODULE_CONST (0) +#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0) +#define MICROPY_COMP_RETURN_IF_EXPR (0) +#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (0) +#define MICROPY_OPT_MAP_LOOKUP_CACHE (0) +#define MICROPY_OPT_MPZ_BITWISE (0) +#define MICROPY_OPT_MATH_FACTORIAL (0) +#define MICROPY_REPL_EMACS_KEYS (0) +#define MICROPY_PY_BUILTINS_COMPLEX (0) +#define MICROPY_MODULE_ATTR_DELEGATION (0) +#define MICROPY_PY_FUNCTION_ATTRS (0) +#define MICROPY_PY_DELATTR_SETATTR (0) +#define MICROPY_PY_BUILTINS_STR_CENTER (0) +#define MICROPY_PY_BUILTINS_STR_PARTITION (0) +#define MICROPY_PY_BUILTINS_STR_SPLITLINES (0) +#define MICROPY_PY_BUILTINS_SLICE_INDICES (0) +#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) +#define MICROPY_PY_BUILTINS_COMPILE (0) +#define MICROPY_PY_BUILTINS_EXECFILE (0) +#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) +#define MICROPY_PY_BUILTINS_POW3 (0) +#define MICROPY_PY___FILE__ (0) +#define MICROPY_PY_MATH_CONSTANTS (0) +#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (0) +#define MICROPY_PY_MATH_FACTORIAL (0) +#define MICROPY_PY_MATH_ISCLOSE (0) +#define MICROPY_PY_IO_FILEIO (MICROPY_VFS) +#define MICROPY_PY_SYS_PS1_PS2 (0) +#define MICROPY_PY_UBINASCII_CRC32 (0) +#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0) + +// Configure other options. #define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C) #define MICROPY_GC_STACK_ENTRY_TYPE uint16_t #define MICROPY_ALLOC_PATH_MAX (128) @@ -16,50 +52,14 @@ #define MICROPY_ALLOC_PARSE_CHUNK_INIT (64) #define MICROPY_DEBUG_PRINTER (&mp_debug_print) #define MICROPY_ENABLE_GC (1) -#define MICROPY_ENABLE_FINALISER (1) -#define MICROPY_STACK_CHECK (1) #define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1) -#define MICROPY_KBD_EXCEPTION (1) #define MICROPY_REPL_EVENT_DRIVEN (0) -#define MICROPY_REPL_AUTO_INDENT (1) -#define MICROPY_HELPER_REPL (1) -#define MICROPY_ENABLE_SOURCE_LINE (1) -#define MICROPY_MODULE_BUILTIN_INIT (1) -#define MICROPY_MODULE_WEAK_LINKS (1) -#define MICROPY_CAN_OVERRIDE_BUILTINS (1) #define MICROPY_USE_INTERNAL_ERRNO (1) -#define MICROPY_ENABLE_SCHEDULER (1) -#define MICROPY_PY_DESCRIPTORS (1) -#define MICROPY_PY_BUILTINS_COMPLEX (0) -#define MICROPY_PY_BUILTINS_STR_UNICODE (1) -#define MICROPY_PY_BUILTINS_MEMORYVIEW (1) -#define MICROPY_PY_BUILTINS_FROZENSET (1) -#define MICROPY_PY_BUILTINS_ROUND_INT (1) -#define MICROPY_PY_BUILTINS_INPUT (1) -#define MICROPY_PY_BUILTINS_HELP (1) #define MICROPY_PY_BUILTINS_HELP_TEXT esp_help_text -#define MICROPY_PY_BUILTINS_HELP_MODULES (1) -#define MICROPY_PY___FILE__ (0) -#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) -#define MICROPY_PY_COLLECTIONS_DEQUE (1) -#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) -#define MICROPY_PY_IO_IOBASE (1) -#define MICROPY_PY_SYS_MAXSIZE (1) -#define MICROPY_PY_SYS_STDFILES (1) -#define MICROPY_PY_UERRNO (1) -#define MICROPY_PY_UBINASCII (1) -#define MICROPY_PY_UCTYPES (1) -#define MICROPY_PY_UHASHLIB (1) #define MICROPY_PY_UHASHLIB_SHA1 (MICROPY_PY_USSL && MICROPY_SSL_AXTLS) -#define MICROPY_PY_UHEAPQ (1) #define MICROPY_PY_UTIMEQ (1) -#define MICROPY_PY_UJSON (1) -#define MICROPY_PY_URANDOM (1) #define MICROPY_PY_URANDOM_SEED_INIT_FUNC (*WDEV_HWRNG) -#define MICROPY_PY_URE (1) -#define MICROPY_PY_USELECT (1) #define MICROPY_PY_UTIME_MP_HAL (1) -#define MICROPY_PY_UZLIB (1) #define MICROPY_PY_LWIP (1) #define MICROPY_PY_LWIP_SOCK_RAW (1) #define MICROPY_PY_MACHINE (1) @@ -79,8 +79,6 @@ #define MICROPY_PY_WEBREPL (1) #define MICROPY_PY_WEBREPL_DELAY (20) #define MICROPY_PY_WEBREPL_STATIC_FILEBUF (1) -#define MICROPY_PY_MICROPYTHON_MEM_INFO (1) -#define MICROPY_PY_UOS (1) #define MICROPY_PY_UOS_INCLUDEFILE "ports/esp8266/moduos.c" #define MICROPY_PY_OS_DUPTERM (2) #define MICROPY_PY_UOS_DUPTERM_NOTIFY (1) @@ -92,7 +90,6 @@ #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_WARNINGS (1) #define MICROPY_PY_STR_BYTES_CMP_WARN (1) -#define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_STREAMS_POSIX_API (1) #define MICROPY_MODULE_FROZEN_LEXER mp_lexer_new_from_str32