Skip to content

Commit 3041881

Browse files
jimmodpgeorge
authored andcommitted
stm32/mpconfigport.h: Use the "extra" feature level.
This commit is a no-op change. Future improvements can come from making individual boards use CORE or BASIC. Signed-off-by: Jim Mussared <[email protected]>
1 parent 0e236ee commit 3041881

File tree

1 file changed

+14
-108
lines changed

1 file changed

+14
-108
lines changed

ports/stm32/mpconfigport.h

Lines changed: 14 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#include "mpconfigboard.h"
3232
#include "mpconfigboard_common.h"
3333

34+
#ifndef MICROPY_CONFIG_ROM_LEVEL
35+
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
36+
#endif
37+
3438
// memory allocation policies
3539
#ifndef MICROPY_GC_STACK_ENTRY_TYPE
3640
#if MICROPY_HW_SDRAM_SIZE
@@ -41,6 +45,16 @@
4145
#endif
4246
#define MICROPY_ALLOC_PATH_MAX (128)
4347

48+
// optimisations
49+
#ifndef MICROPY_OPT_COMPUTED_GOTO
50+
#define MICROPY_OPT_COMPUTED_GOTO (1)
51+
#endif
52+
53+
// Don't enable lookup cache on M0 (low RAM)
54+
#ifndef MICROPY_OPT_MAP_LOOKUP_CACHE
55+
#define MICROPY_OPT_MAP_LOOKUP_CACHE (__CORTEX_M > 0)
56+
#endif
57+
4458
// emitters
4559
#define MICROPY_PERSISTENT_CODE_LOAD (1)
4660
#ifndef MICROPY_EMIT_THUMB
@@ -50,146 +64,41 @@
5064
#define MICROPY_EMIT_INLINE_THUMB (1)
5165
#endif
5266

53-
// compiler configuration
54-
#define MICROPY_COMP_MODULE_CONST (1)
55-
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
56-
#define MICROPY_COMP_RETURN_IF_EXPR (1)
57-
58-
// optimisations
59-
#ifndef MICROPY_OPT_COMPUTED_GOTO
60-
#define MICROPY_OPT_COMPUTED_GOTO (1)
61-
#endif
62-
#ifndef MICROPY_OPT_LOAD_ATTR_FAST_PATH
63-
#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (1)
64-
#endif
65-
#ifndef MICROPY_OPT_MAP_LOOKUP_CACHE
66-
#define MICROPY_OPT_MAP_LOOKUP_CACHE (__CORTEX_M > 0)
67-
#endif
68-
#define MICROPY_OPT_MPZ_BITWISE (1)
69-
#define MICROPY_OPT_MATH_FACTORIAL (1)
70-
7167
// Python internal features
7268
#define MICROPY_READER_VFS (1)
7369
#define MICROPY_ENABLE_GC (1)
74-
#define MICROPY_ENABLE_FINALISER (1)
75-
#define MICROPY_STACK_CHECK (1)
7670
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
7771
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (0)
78-
#define MICROPY_KBD_EXCEPTION (1)
79-
#define MICROPY_HELPER_REPL (1)
80-
#define MICROPY_REPL_INFO (1)
81-
#define MICROPY_REPL_EMACS_KEYS (1)
82-
#define MICROPY_REPL_AUTO_INDENT (1)
8372
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
84-
#define MICROPY_ENABLE_SOURCE_LINE (1)
8573
#ifndef MICROPY_FLOAT_IMPL // can be configured by each board via mpconfigboard.mk
8674
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
8775
#endif
88-
#define MICROPY_STREAMS_NON_BLOCK (1)
89-
#define MICROPY_MODULE_BUILTIN_INIT (1)
90-
#define MICROPY_MODULE_WEAK_LINKS (1)
91-
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
9276
#define MICROPY_USE_INTERNAL_ERRNO (1)
93-
#define MICROPY_ENABLE_SCHEDULER (1)
9477
#define MICROPY_SCHEDULER_DEPTH (8)
9578
#define MICROPY_VFS (1)
9679

9780
// control over Python builtins
98-
#define MICROPY_PY_FUNCTION_ATTRS (1)
99-
#define MICROPY_PY_DESCRIPTORS (1)
100-
#define MICROPY_PY_DELATTR_SETATTR (1)
101-
#ifndef MICROPY_PY_FSTRINGS
102-
#define MICROPY_PY_FSTRINGS (1)
103-
#endif
104-
#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
105-
#define MICROPY_PY_BUILTINS_STR_CENTER (1)
106-
#define MICROPY_PY_BUILTINS_STR_PARTITION (1)
107-
#define MICROPY_PY_BUILTINS_STR_SPLITLINES (1)
108-
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
109-
#define MICROPY_PY_BUILTINS_FROZENSET (1)
110-
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
111-
#define MICROPY_PY_BUILTINS_SLICE_INDICES (1)
112-
#define MICROPY_PY_BUILTINS_ROUND_INT (1)
113-
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
114-
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
115-
#define MICROPY_PY_BUILTINS_COMPILE (MICROPY_ENABLE_COMPILER)
116-
#define MICROPY_PY_BUILTINS_EXECFILE (MICROPY_ENABLE_COMPILER)
117-
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
118-
#define MICROPY_PY_BUILTINS_INPUT (1)
119-
#define MICROPY_PY_BUILTINS_POW3 (1)
120-
#define MICROPY_PY_BUILTINS_HELP (1)
12181
#ifndef MICROPY_PY_BUILTINS_HELP_TEXT
12282
#define MICROPY_PY_BUILTINS_HELP_TEXT stm32_help_text
12383
#endif
124-
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
125-
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
126-
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
127-
#define MICROPY_PY_COLLECTIONS_DEQUE (1)
128-
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
129-
#define MICROPY_PY_MATH_SPECIAL_FUNCTIONS (1)
130-
#define MICROPY_PY_MATH_ISCLOSE (1)
131-
#define MICROPY_PY_MATH_FACTORIAL (1)
132-
#define MICROPY_PY_CMATH (1)
133-
#define MICROPY_PY_IO (1)
134-
#define MICROPY_PY_IO_IOBASE (1)
13584
#define MICROPY_PY_IO_FILEIO (MICROPY_VFS_FAT || MICROPY_VFS_LFS1 || MICROPY_VFS_LFS2)
136-
#define MICROPY_PY_SYS_MAXSIZE (1)
137-
#define MICROPY_PY_SYS_EXIT (1)
138-
#define MICROPY_PY_SYS_STDFILES (1)
139-
#define MICROPY_PY_SYS_STDIO_BUFFER (1)
14085
#ifndef MICROPY_PY_SYS_PLATFORM // let boards override it if they want
14186
#define MICROPY_PY_SYS_PLATFORM "pyboard"
14287
#endif
143-
#define MICROPY_PY_UERRNO (1)
14488
#ifndef MICROPY_PY_THREAD
14589
#define MICROPY_PY_THREAD (0)
14690
#endif
14791

14892
// extended modules
149-
#ifndef MICROPY_PY_UASYNCIO
150-
#define MICROPY_PY_UASYNCIO (1)
151-
#endif
152-
#ifndef MICROPY_PY_UCTYPES
153-
#define MICROPY_PY_UCTYPES (1)
154-
#endif
155-
#ifndef MICROPY_PY_UZLIB
156-
#define MICROPY_PY_UZLIB (1)
157-
#endif
158-
#ifndef MICROPY_PY_UJSON
159-
#define MICROPY_PY_UJSON (1)
160-
#endif
161-
#ifndef MICROPY_PY_URE
162-
#define MICROPY_PY_URE (1)
163-
#endif
164-
#ifndef MICROPY_PY_URE_SUB
165-
#define MICROPY_PY_URE_SUB (1)
166-
#endif
167-
#ifndef MICROPY_PY_UHEAPQ
168-
#define MICROPY_PY_UHEAPQ (1)
169-
#endif
170-
#ifndef MICROPY_PY_UHASHLIB
171-
#define MICROPY_PY_UHASHLIB (1)
172-
#endif
17393
#define MICROPY_PY_UHASHLIB_MD5 (MICROPY_PY_USSL)
17494
#define MICROPY_PY_UHASHLIB_SHA1 (MICROPY_PY_USSL)
17595
#define MICROPY_PY_UCRYPTOLIB (MICROPY_PY_USSL)
176-
#ifndef MICROPY_PY_UBINASCII
177-
#define MICROPY_PY_UBINASCII (1)
178-
#define MICROPY_PY_UBINASCII_CRC32 (1)
179-
#endif
18096
#ifndef MICROPY_PY_UOS
18197
#define MICROPY_PY_UOS (1)
18298
#endif
18399
#define MICROPY_PY_OS_DUPTERM (3)
184100
#define MICROPY_PY_UOS_DUPTERM_BUILTIN_STREAM (1)
185-
#ifndef MICROPY_PY_URANDOM
186-
#define MICROPY_PY_URANDOM (1)
187101
#define MICROPY_PY_URANDOM_SEED_INIT_FUNC (rng_get())
188-
#endif
189-
#ifndef MICROPY_PY_URANDOM_EXTRA_FUNCS
190-
#define MICROPY_PY_URANDOM_EXTRA_FUNCS (1)
191-
#endif
192-
#define MICROPY_PY_USELECT (1)
193102
#ifndef MICROPY_PY_UTIME
194103
#define MICROPY_PY_UTIME (1)
195104
#endif
@@ -216,9 +125,6 @@
216125
#define MICROPY_HW_SOFTSPI_MAX_BAUDRATE (HAL_RCC_GetSysClockFreq() / 48)
217126
#define MICROPY_PY_UWEBSOCKET (MICROPY_PY_LWIP)
218127
#define MICROPY_PY_WEBREPL (MICROPY_PY_LWIP)
219-
#ifndef MICROPY_PY_FRAMEBUF
220-
#define MICROPY_PY_FRAMEBUF (1)
221-
#endif
222128
#ifndef MICROPY_PY_USOCKET
223129
#define MICROPY_PY_USOCKET (1)
224130
#endif

0 commit comments

Comments
 (0)