diff options
| author | Dan Halbert <halbert@halwitz.org> | 2018-01-09 20:41:41 -0500 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2018-01-16 18:11:54 -0800 |
| commit | 01443a9619e7cbedd1697418855243cd95e0e674 (patch) | |
| tree | bf036417f80f9f4dd45818952e464f3ac652879c | |
| parent | d201ac20af8733b5220df38251e3531c25f34cab (diff) | |
Make chosen features consistent across all boards and ports atmel-samd, esp8266, and nrf.
1. Turn off MICROPY_CPYTHON_COMPAT, which includes a number of minor CPython compatibility features,
most of which have workarounds, but uses up significant flash.
2. Turn on MICROPY_PY_SYS_MAXSIZE, which implements sys.maxsize.
3. Turn on MICROPY_CAN_OVERRIDE_BUILTINS, which implements "_" as the most recent value in the REPL,
and also enables redefining builtins.
| -rw-r--r-- | ports/atmel-samd/mpconfigport.h | 8 | ||||
| -rw-r--r-- | ports/esp8266/mpconfigport.h | 2 | ||||
| -rw-r--r-- | ports/nrf/mpconfigport.h | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index f15efca96..64a7044f1 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -6,13 +6,13 @@ #define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C) // options to control how MicroPython is built - #define MICROPY_QSTR_BYTES_IN_HASH (1) #define MICROPY_ALLOC_PATH_MAX (256) #define MICROPY_ALLOC_PARSE_CHUNK_INIT (16) // TODO(tannewt): Reduce this number if we want the REPL to function under 512 // free bytes. // #define MICROPY_ALLOC_PARSE_RULE_INIT (64) +#define MICROPY_CAN_OVERRIDE_BUILTINS (1) #define MICROPY_EMIT_X64 (0) #define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0) @@ -20,6 +20,8 @@ #define MICROPY_COMP_CONST (1) #define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1) #define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1) +// Turn off for consistency +#define MICROPY_CPYTHON_COMPAT (0) #define MICROPY_MEM_STATS (0) #define MICROPY_DEBUG_PRINTERS (0) #define MICROPY_ENABLE_GC (1) @@ -59,6 +61,7 @@ #define MICROPY_PY_URANDOM_EXTRA_FUNCS (0) #define MICROPY_PY_STRUCT (0) #define MICROPY_PY_SYS (1) +#define MICROPY_PY_SYS_MAXSIZE (1) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_STREAMS_NON_BLOCK (1) @@ -186,8 +189,6 @@ extern const struct _mp_obj_module_t usb_hid_module; #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (1) #define MICROPY_PY_ALL_SPECIAL_METHODS (1) - #define MICROPY_PY_SYS_MAXSIZE (1) - #define MICROPY_CPYTHON_COMPAT (1) // Scan gamepad every 32ms #define CIRCUITPY_GAMEPAD_TICKS 0x1f @@ -206,7 +207,6 @@ extern const struct _mp_obj_module_t usb_hid_module; #define MICROPY_PY_BUILTINS_COMPLEX (0) #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0) - #define MICROPY_CPYTHON_COMPAT (0) #endif // Disabled for now. diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h index c99bc4988..479484a43 100644 --- a/ports/esp8266/mpconfigport.h +++ b/ports/esp8266/mpconfigport.h @@ -87,7 +87,7 @@ #define MICROPY_PY_FRAMEBUF (1) #define MICROPY_PY_MICROPYTHON_MEM_INFO (1) #define MICROPY_PY_OS_DUPTERM (1) -#define MICROPY_CPYTHON_COMPAT (1) +#define MICROPY_CPYTHON_COMPAT (0) #define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL) diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 7e23486ad..2f7c19d3a 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -81,6 +81,7 @@ #define mp_builtin_open_obj mp_vfs_open_obj #endif +#define MICROPY_CPYTHON_COMPAT (0) #define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_MODULE_WEAK_LINKS (1) #define MICROPY_CAN_OVERRIDE_BUILTINS (1) |
