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.
This commit is contained in:
Dan Halbert 2018-01-09 20:41:41 -05:00 committed by Scott Shawcroft
parent d201ac20af
commit 01443a9619
3 changed files with 6 additions and 5 deletions

View File

@ -6,13 +6,13 @@
#define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C) #define MICROPY_OBJ_REPR (MICROPY_OBJ_REPR_C)
// options to control how MicroPython is built // options to control how MicroPython is built
#define MICROPY_QSTR_BYTES_IN_HASH (1) #define MICROPY_QSTR_BYTES_IN_HASH (1)
#define MICROPY_ALLOC_PATH_MAX (256) #define MICROPY_ALLOC_PATH_MAX (256)
#define MICROPY_ALLOC_PARSE_CHUNK_INIT (16) #define MICROPY_ALLOC_PARSE_CHUNK_INIT (16)
// TODO(tannewt): Reduce this number if we want the REPL to function under 512 // TODO(tannewt): Reduce this number if we want the REPL to function under 512
// free bytes. // free bytes.
// #define MICROPY_ALLOC_PARSE_RULE_INIT (64) // #define MICROPY_ALLOC_PARSE_RULE_INIT (64)
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
#define MICROPY_EMIT_X64 (0) #define MICROPY_EMIT_X64 (0)
#define MICROPY_EMIT_THUMB (0) #define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0) #define MICROPY_EMIT_INLINE_THUMB (0)
@ -20,6 +20,8 @@
#define MICROPY_COMP_CONST (1) #define MICROPY_COMP_CONST (1)
#define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1) #define MICROPY_COMP_DOUBLE_TUPLE_ASSIGN (1)
#define MICROPY_COMP_TRIPLE_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_MEM_STATS (0)
#define MICROPY_DEBUG_PRINTERS (0) #define MICROPY_DEBUG_PRINTERS (0)
#define MICROPY_ENABLE_GC (1) #define MICROPY_ENABLE_GC (1)
@ -59,6 +61,7 @@
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (0) #define MICROPY_PY_URANDOM_EXTRA_FUNCS (0)
#define MICROPY_PY_STRUCT (0) #define MICROPY_PY_STRUCT (0)
#define MICROPY_PY_SYS (1) #define MICROPY_PY_SYS (1)
#define MICROPY_PY_SYS_MAXSIZE (1)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_STREAMS_NON_BLOCK (1) #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_BUILTIN_METHOD_CHECK_SELF_ARG (1)
#define MICROPY_PY_ALL_SPECIAL_METHODS (1) #define MICROPY_PY_ALL_SPECIAL_METHODS (1)
#define MICROPY_PY_SYS_MAXSIZE (1)
#define MICROPY_CPYTHON_COMPAT (1)
// Scan gamepad every 32ms // Scan gamepad every 32ms
#define CIRCUITPY_GAMEPAD_TICKS 0x1f #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_PY_BUILTINS_COMPLEX (0)
#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0) #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
#define MICROPY_CPYTHON_COMPAT (0)
#endif #endif
// Disabled for now. // Disabled for now.

View File

@ -87,7 +87,7 @@
#define MICROPY_PY_FRAMEBUF (1) #define MICROPY_PY_FRAMEBUF (1)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1) #define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_OS_DUPTERM (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_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT) #define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL) #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)

View File

@ -81,6 +81,7 @@
#define mp_builtin_open_obj mp_vfs_open_obj #define mp_builtin_open_obj mp_vfs_open_obj
#endif #endif
#define MICROPY_CPYTHON_COMPAT (0)
#define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_MODULE_WEAK_LINKS (1) #define MICROPY_MODULE_WEAK_LINKS (1)
#define MICROPY_CAN_OVERRIDE_BUILTINS (1) #define MICROPY_CAN_OVERRIDE_BUILTINS (1)