Commit c5878dd1 authored by Andrew Leech's avatar Andrew Leech Committed by Damien George

nrf/mpconfigport: Enable extra features as defined by ROM levels.

This commit enables extra features from the ROM levels and further
simplifies mpconfigport.h.  The changes are:

- NRF51822 & BLUETOOTH_SD -> MICROPY_CONFIG_ROM_LEVEL_MINIMUM
    - no changes

- NRF51822 -> MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES
    - MICROPY_PY_IO = 1

- NRF52832 -> MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES
    - MICROPY_PY_IO = 1

- NRF52840, NRF9160 -> MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES
    - MICROPY_COMP_MODULE_CONST = 1
    - MICROPY_COMP_TRIPLE_TUPLE_ASSIGN = 1
    - MICROPY_OPT_MPZ_BITWISE = 1
    - MICROPY_PY_ALL_SPECIAL_METHODS = 1
    - MICROPY_PY_BUILTINS_EXECFILE = 1
    - MICROPY_PY_BUILTINS_SLICE_ATTRS = 1
    - MICROPY_PY_BUILTINS_STR_CENTER = 1
    - MICROPY_PY_BUILTINS_STR_PARTITION = 1
    - MICROPY_PY_BUILTINS_STR_SPLITLINES = 1
    - MICROPY_PY_CMATH = 1
    - MICROPY_PY_COLLECTIONS_ORDEREDDICT = 1
    - MICROPY_PY_FRAMEBUF = 1
    - MICROPY_PY_IO = 1
    - MICROPY_PY_MATH_SPECIAL_FUNCTIONS = 1
    - MICROPY_PY_SYS_STDIO_BUFFER = 1
    - MICROPY_PY_UCTYPES = 1
    - MICROPY_PY_UHEAPQ = 1
    - MICROPY_PY_UJSON = 1
    - MICROPY_PY_URE = 1
    - MICROPY_PY_UZLIB = 1
    - MICROPY_REPL_EMACS_KEYS = 1
parent 13f5d38f
......@@ -63,6 +63,7 @@
#define MICROPY_VFS (CORE_FEAT)
#endif
// micro:bit filesystem
#ifndef MICROPY_MBFS
#define MICROPY_MBFS (!MICROPY_VFS)
#endif
......@@ -101,15 +102,12 @@
#define MICROPY_ALLOC_PATH_MAX (512)
#define MICROPY_PERSISTENT_CODE_LOAD (1)
#define MICROPY_COMP_MODULE_CONST (0)
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0)
#define MICROPY_READER_VFS (MICROPY_VFS)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_STACK_CHECK (1)
#define MICROPY_HELPER_REPL (1)
#define MICROPY_REPL_INFO (1)
#define MICROPY_REPL_EMACS_KEYS (0)
#define MICROPY_REPL_AUTO_INDENT (1)
#define MICROPY_KBD_EXCEPTION (1)
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
......@@ -122,9 +120,6 @@
#define MICROPY_ALLOC_GC_STACK_SIZE (32)
#endif
#define MICROPY_OPT_COMPUTED_GOTO (0)
#define MICROPY_OPT_MPZ_BITWISE (0)
// fatfs configuration used in ffconf.h
#define MICROPY_FATFS_ENABLE_LFN (1)
#define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
......@@ -142,10 +137,8 @@
#define mp_type_fileio fatfs_type_fileio
#define mp_type_textio fatfs_type_textio
// Enable micro:bit filesystem by default.
#ifndef MICROPY_MBFS
#define MICROPY_MBFS (1)
#endif
// Use port specific uos module rather than extmod variant.
#define MICROPY_PY_UOS (0)
#define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_MODULE_WEAK_LINKS (1)
......@@ -153,42 +146,24 @@
#define MICROPY_USE_INTERNAL_ERRNO (1)
#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
#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_MEMORYVIEW (1)
#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_BUILTINS_EXECFILE (0)
#define MICROPY_PY_BUILTINS_COMPILE (1)
#define MICROPY_PY_BUILTINS_HELP (1)
#define MICROPY_PY_BUILTINS_HELP_TEXT nrf5_help_text
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
#define MICROPY_MODULE_BUILTIN_INIT (1)
#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (0)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_PY_SYS_MAXSIZE (1)
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0)
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (0)
#define MICROPY_PY_CMATH (0)
#define MICROPY_PY_IO (0)
#define MICROPY_PY_IO_FILEIO (MICROPY_VFS_FAT || MICROPY_VFS_LFS1 || MICROPY_VFS_LFS2)
#define MICROPY_PY_URANDOM (1)
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
#define MICROPY_PY_UCTYPES (0)
#define MICROPY_PY_UZLIB (0)
#define MICROPY_PY_UJSON (0)
#define MICROPY_PY_URE (0)
#define MICROPY_PY_UHEAPQ (0)
#define MICROPY_PY_UTIME_MP_HAL (1)
#define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE_PULSE (0)
#define MICROPY_PY_MACHINE_SOFTI2C (MICROPY_PY_MACHINE_I2C)
#define MICROPY_PY_MACHINE_SPI (0)
#define MICROPY_PY_MACHINE_SPI_MIN_DELAY (0)
#define MICROPY_PY_FRAMEBUF (0)
#ifndef MICROPY_HW_LED_COUNT
#define MICROPY_HW_LED_COUNT (0)
......@@ -324,7 +299,6 @@ extern const struct _mp_obj_module_t music_module;
#define MICROPY_PORT_CONSTANTS \
{ MP_ROM_QSTR(MP_QSTR_board), MP_ROM_PTR(&board_module) }, \
{ MP_ROM_QSTR(MP_QSTR_machine), MP_ROM_PTR(&mp_module_machine) }, \
BLE_MODULE \
#define MP_STATE_PORT MP_STATE_VM
......@@ -379,38 +353,3 @@ extern const struct _mp_obj_module_t music_module;
#ifndef MP_NEED_LOG2
#define MP_NEED_LOG2 (1)
#endif
// Disable extra features enabled by EXTRA on NRF52840 & NRF9160
// to initially preserve existing feature set
#if (EXTRA_FEAT)
#define MICROPY_COMP_RETURN_IF_EXPR (0)
#define MICROPY_ENABLE_SCHEDULER (0)
#define MICROPY_MODULE_ATTR_DELEGATION (0)
#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (0)
#define MICROPY_OPT_MAP_LOOKUP_CACHE (0)
#define MICROPY_OPT_MATH_FACTORIAL (0)
#define MICROPY_PY_BUILTINS_INPUT (0)
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0)
#define MICROPY_PY_BUILTINS_POW3 (0)
#define MICROPY_PY_BUILTINS_ROUND_INT (0)
#define MICROPY_PY_BUILTINS_SLICE_INDICES (0)
#define MICROPY_PY_COLLECTIONS_DEQUE (0)
#define MICROPY_PY_DELATTR_SETATTR (0)
#define MICROPY_PY_DESCRIPTORS (0)
#define MICROPY_PY_FSTRINGS (0)
#define MICROPY_PY_IO_IOBASE (0)
#define MICROPY_PY_MATH_CONSTANTS (0)
#define MICROPY_PY_MATH_FACTORIAL (0)
#define MICROPY_PY_MATH_ISCLOSE (0)
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
#define MICROPY_PY_SYS_ATTR_DELEGATION (0)
#define MICROPY_PY_SYS_PS1_PS2 (0)
#define MICROPY_PY_UASYNCIO (0)
#define MICROPY_PY_UBINASCII_CRC32 (0)
#define MICROPY_PY_UERRNO (0)
#define MICROPY_PY_UHASHLIB (0)
#define MICROPY_PY_UOS (0)
#define MICROPY_PY_UOS_STATVFS (0)
#define MICROPY_PY_URE_SUB (0)
#define MICROPY_PY_USELECT (0)
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment