8000 nrf/mpconfigport: Enable extra features as defined by ROM levels. · micropython/micropython@c5878dd · GitHub
[go: up one dir, main page]

Skip to content

Commit c5878dd

Browse files
pi-anldpgeorge
authored andcommitted
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
1 parent 13f5d38 commit c5878dd

File tree

1 file changed

+3
-64
lines changed

1 file changed

+3
-64
lines changed

ports/nrf/mpconfigport.h

Lines changed: 3 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#define MICROPY_VFS (CORE_FEAT)
6464
#endif
6565

66+
// micro:bit filesystem
6667
#ifndef MICROPY_MBFS
6768
#define MICROPY_MBFS (!MICROPY_VFS)
6869
#endif
@@ -101,15 +102,12 @@
101102

102103
#define MICROPY_ALLOC_PATH_MAX (512)
103104
#define MICROPY_PERSISTENT_CODE_LOAD (1)
104-
#define MICROPY_COMP_MODULE_CONST (0)
105-
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0)
106105
#define MICROPY_READER_VFS (MICROPY_VFS)
107106
#define MICROPY_ENABLE_GC (1)
108107
#define MICROPY_ENABLE_FINALISER (1)
109108
#define MICROPY_STACK_CHECK (1)
110109
#define MICROPY_HELPER_REPL (1)
111110
#define MICROPY_REPL_INFO (1)
112-
#define MICROPY_REPL_EMACS_KEYS (0)
113111
#define MICROPY_REPL_AUTO_INDENT (1)
114112
#define MICROPY_KBD_EXCEPTION (1)
115113
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
@@ -122,9 +120,6 @@
122120
#define MICROPY_ALLOC_GC_STACK_SIZE (32)
123121
#endif
124122

125-
#define MICROPY_OPT_COMPUTED_GOTO (0)
126-
#define MICROPY_OPT_MPZ_BITWISE (0)
127-
128123
// fatfs configuration used in ffconf.h
129124
#define MICROPY_FATFS_ENABLE_LFN (1)
130125
#define MICROPY_FATFS_LFN_CODE_PAGE 437 /* 1=SFN/ANSI 437=LFN/U.S.(OEM) */
@@ -142,53 +137,33 @@
142137
#define mp_type_fileio fatfs_type_fileio
143138
#define mp_type_textio fatfs_type_textio
144139

145-
// Enable micro:bit filesystem by default.
146-
#ifndef MICROPY_MBFS
147-
#define MICROPY_MBFS (1)
148-
#endif
140+
// Use port specific uos module rather than extmod variant.
141+
#define MICROPY_PY_UOS (0)
149142

150143
#define MICROPY_STREAMS_NON_BLOCK (1)
151144
#define MICROPY_MODULE_WEAK_LINKS (1)
152145
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
153146
#define MICROPY_USE_INTERNAL_ERRNO (1)
154147
#define MICROPY_PY_FUNCTION_ATTRS (1)
155148
#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
156-
#define MICROPY_PY_BUILTINS_STR_CENTER (0)
157-
#define MICROPY_PY_BUILTINS_STR_PARTITION (0)
158-
#define MICROPY_PY_BUILTINS_STR_SPLITLINES (0)
159149
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
160150
#define MICROPY_PY_BUILTINS_FROZENSET (1)
161-
#define MICROPY_PY_BUILTINS_EXECFILE (0)
162151
#define MICROPY_PY_BUILTINS_COMPILE (1)
163152
#define MICROPY_PY_BUILTINS_HELP (1)
164153
#define MICROPY_PY_BUILTINS_HELP_TEXT nrf5_help_text
165154
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
166155
#define MICROPY_MODULE_BUILTIN_INIT (1)
167-
#define MICROPY_PY_ALL_SPECIAL_METHODS (0)
168156
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
169-
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (0)
170-
#define MICROPY_PY_SYS_EXIT (1)
171157
#define MICROPY_PY_SYS_MAXSIZE (1)
172-
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
173-
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0)
174-
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (0)
175-
#define MICROPY_PY_CMATH (0)
176-
#define MICROPY_PY_IO (0)
177158
#define MICROPY_PY_IO_FILEIO (MICROPY_VFS_FAT || MICROPY_VFS_LFS1 || MICROPY_VFS_LFS2)
178159
#define MICROPY_PY_URANDOM (1)
179160
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
180-
#define MICROPY_PY_UCTYPES (0)
181-
#define MICROPY_PY_UZLIB (0)
182-
#define MICROPY_PY_UJSON (0)
183-
#define MICROPY_PY_URE (0)
184-
#define MICROPY_PY_UHEAPQ (0)
185161
#define MICROPY_PY_UTIME_MP_HAL (1)
186162
#define MICROPY_PY_MACHINE (1)
187163
#define MICROPY_PY_MACHINE_PULSE (0)
188164
#define MICROPY_PY_MACHINE_SOFTI2C (MICROPY_PY_MACHINE_I2C)
189165
#define MICROPY_PY_MACHINE_SPI (0)
190166
#define MICROPY_PY_MACHINE_SPI_MIN_DELAY (0)
191-
#define MICROPY_PY_FRAMEBUF (0)
192167

193168
#ifndef MICROPY_HW_LED_COUNT
194169
#define MICROPY_HW_LED_COUNT (0)
@@ -324,7 +299,6 @@ extern const struct _mp_obj_module_t music_module;
324299
#define MICROPY_PORT_CONSTANTS \
325300
{ MP_ROM_QSTR(MP_QSTR_board), MP_ROM_PTR(&board_module) }, \
326301
{ MP_ROM_QSTR(MP_QSTR_machine), MP_ROM_PTR(&mp_module_machine) }, \
327-
BLE_MODULE \
328302

329303
#define MP_STATE_PORT MP_STATE_VM
330304

@@ -379,38 +353,3 @@ extern const struct _mp_obj_module_t music_module;
379353
#ifndef MP_NEED_LOG2
380354
#define MP_NEED_LOG2 (1)
381355
#endif
382-
383-
// Disable extra features enabled by EXTRA on NRF52840 & NRF9160
384-
// to initially preserve existing feature set
385-
#if (EXTRA_FEAT)
386-
#define MICROPY_COMP_RETURN_IF_EXPR (0)
387-
#define MICROPY_ENABLE_SCHEDULER (0)
388-
#define MICROPY_MODULE_ATTR_DELEGATION (0)
389-
#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (0)
390-
#define MICROPY_OPT_MAP_LOOKUP_CACHE (0)
391-
#define MICROPY_OPT_MATH_FACTORIAL (0)
392-
#define MICROPY_PY_BUILTINS_INPUT (0)
393-
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0)
394-
#define MICROPY_PY_BUILTINS_POW3 (0)
395-
#define MICROPY_PY_BUILTINS_ROUND_INT (0)
396-
#define MICROPY_PY_BUILTINS_SLICE_INDICES (0)
397-
#define MICROPY_PY_COLLECTIONS_DEQUE (0)
398-
#define MICROPY_PY_DELATTR_SETATTR (0)
399-
#define MICROPY_PY_DESCRIPTORS (0)
400-
#define MICROPY_PY_FSTRINGS (0)
401-
#define MICROPY_PY_IO_IOBASE (0)
402-
#define MICROPY_PY_MATH_CONSTANTS (0)
403-
#define MICROPY_PY_MATH_FACTORIAL (0)
404-
#define MICROPY_PY_MATH_ISCLOSE (0)
405-
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (0)
406-
#define MICROPY_PY_SYS_ATTR_DELEGATION (0)
407-
#define MICROPY_PY_SYS_PS1_PS2 (0)
408-
#define MICROPY_PY_UASYNCIO (0)
409-
#define MICROPY_PY_UBINASCII_CRC32 (0)
410-
#define MICROPY_PY_UERRNO (0)
411-
#define MICROPY_PY_UHASHLIB (0)
412-
#define MICROPY_PY_UOS (0)
413-
#define MICROPY_PY_UOS_STATVFS (0)
414-
#define MICROPY_PY_URE_SUB (0)
415-
#define MICROPY_PY_USELECT (0)
416-
#endif

0 commit comments

Comments
 (0)
0