8000 samd/mpconfigport: Simplify and consolidate config options. · pimoroni/micropython@e456ee4 · GitHub
[go: up one dir, main page]

Skip to content

Commit e456ee4

Browse files
committed
samd/mpconfigport: Simplify and consolidate config options.
This is a no-op in terms of firmware functionality. Signed-off-by: Damien George <damien@micropython.org>
1 parent 7ecff51 commit e456ee4

File tree

3 files changed

+34
-62
lines changed

3 files changed

+34
-62
lines changed

ports/samd/mcu/samd21/mpconfigmcu.h

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,32 @@
1414
#define MICROPY_EMIT_THUMB_ARMV7M (0)
1515
#define MICROPY_MODULE_BUILTIN_INIT (1)
1616

17-
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
18-
19-
#ifndef MICROPY_PY_MATH
20-
#define MICROPY_PY_MATH (1)
21-
#define MP_NEED_LOG2 (1)
22-
#endif
23-
24-
#ifndef MICROPY_PY_BUILTINS_COMPLEX
25-
#define MICROPY_PY_BUILTINS_COMPLEX (0)
26-
#endif
27-
28-
#ifndef MICROPY_PY_CMATH
29-
#define MICROPY_PY_CMATH (0)
30-
#endif
17+
// Selected extensions beyond the basic features set.
18+
#define MICROPY_ENABLE_FINALISER (1)
19+
#define MICROPY_KBD_EXCEPTION (1)
20+
#define MICROPY_HELPER_REPL (1)
21+
#define MICROPY_REPL_AUTO_INDENT (1)
22+
#define MICROPY_ENABLE_SOURCE_LINE (1)
23+
#define MICROPY_STREAMS_NON_BLOCK (1)
24+
#define MICROPY_PY_BUILTINS_HELP (1)
25+
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
26+
#define MICROPY_ENABLE_SCHEDULER (1)
27+
#define MICROPY_PY_BUILTINS_BYTES_HEX (1)
28+
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
29+
#define MICROPY_PY_BUILTINS_INPUT (1)
30+
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
31+
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
32+
#define MICROPY_PY_SYS_STDFILES (1)
33+
#define MICROPY_PY_SYS_MAXSIZE (1)
34+
#define MICROPY_PY_IO_IOBASE (1)
35+
#define MICROPY_PY_OS (1)
36+
#define MICROPY_PY_JSON (1)
37+
#define MICROPY_PY_RE (1)
38+
#define MICROPY_PY_BINASCII (1)
39+
#define MICROPY_PY_UCTYPES (1)
40+
#define MICROPY_PY_HEAPQ (1)
41+
#define MICROPY_PY_RANDOM (1)
42+
#define MICROPY_PY_PLATFORM (1)
3143

3244
#define MICROPY_PY_RANDOM_SEED_INIT_FUNC (trng_random_u32(300))
3345
unsigned long trng_random_u32(int delay);

ports/samd/mcu/samd51/mpconfigmcu.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,6 @@
1010
// Python internal features
1111
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
1212

13-
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
14-
15-
#ifndef MICROPY_PY_BUILTINS_COMPLEX
16-
#define MICROPY_PY_BUILTINS_COMPLEX (0)
17-
#endif
18-
19-
#ifndef MICROPY_PY_MATH
20-
#define MICROPY_PY_MATH (1)
21-
#define MP_NEED_LOG2 (1)
22-
#endif
23-
24-
#ifndef MICROPY_PY_CMATH
25-
#define MICROPY_PY_CMATH (0)
26-
#endif
27-
2813
#define MICROPY_PY_OS_SYNC (1)
2914
#define MICROPY_PY_OS_URANDOM (1)
3015
#define MICROPY_PY_ONEWIRE (1)

ports/samd/mpconfigport.h

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,18 @@
4040
// MicroPython emitters
4141
#define MICROPY_PERSISTENT_CODE_LOAD (1)
4242

43-
// Compiler configuration
44-
#define MICROPY_COMP_CONST (1)
45-
4643
// Python internal features
4744
#define MICROPY_ENABLE_GC (1)
48-
#define MICROPY_ENABLE_FINALISER (1)
49-
#define MICROPY_KBD_EXCEPTION (1)
50-
#define MICROPY_HELPER_REPL (1)
51-
#define MICROPY_REPL_AUTO_INDENT (1)
5245
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
53-
#define MICROPY_ENABLE_SOURCE_LINE (1)
54-
#define MICROPY_STREAMS_NON_BLOCK (1)
46+
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
47+
#ifndef MICROPY_PY_BUILTINS_COMPLEX
48+
#define MICROPY_PY_BUILTINS_COMPLEX (0)
49+
#endif
5550
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
56-
#define MICROPY_PY_BUILTINS_HELP (1)
5751
#define MICROPY_PY_BUILTINS_HELP_TEXT samd_help_text
58-
#define MICROPY_PY_BUILTINS_HELP_MODULES (1)
5952
#define MICROPY_USE_INTERNAL_ERRNO (1)
60-
#define MICROPY_ENABLE_SCHEDULER (1)
6153
#define MICROPY_SCHEDULER_STATIC_NODES (1)
54+
6255
#define MICROPY_HW_ENABLE_USBDEV (1)
6356
#define MICROPY_HW_USB_CDC_1200BPS_TOUCH (1)
6457

@@ -71,22 +64,9 @@
7164
#ifndef MICROPY_HW_USB_DESC_STR_MAX
7265
#define MICROPY_HW_USB_DESC_STR_MAX (32)
7366
#endif
74-
7567
#endif
7668

77-
// Control over Python builtins
78-
#define MICROPY_PY_BUILTINS_BYTES_HEX (1)
79-
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
80-
#define MICROPY_PY_BUILTINS_INPUT (1)
81-
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
82-
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
83-
#define MICROPY_PY_SYS (1)
8469
#define MICROPY_PY_SYS_PLATFORM "samd"
85-
#define MICROPY_PY_SYS_EXIT (1)
86-
#define MICROPY_PY_SYS_STDFILES (1)
87-
#define MICROPY_PY_SYS_MAXSIZE (1)
88-
#define MICROPY_PY_IO (1)
89-
#define MICROPY_PY_IO_IOBASE (1)
9070

9171
// Extended modules
9272
#define MICROPY_PY_TIME_GMTIME_LOCALTIME_MKTIME (1)
@@ -97,16 +77,9 @@
9777
#define MICROPY_PY_MACHINE_BARE_METAL_FUNCS (1)
9878
#define MICROPY_PY_MACHINE_BOOTLOADER (1)
9979
#define MICROPY_PY_MACHINE_DISABLE_IRQ_ENABLE_IRQ (1)
100-
#define MICROPY_PY_OS (1)
10180
#define MICROPY_PY_OS_INCLUDEFILE "ports/samd/modos.c"
10281
#define MICROPY_READER_VFS (1)
10382
#define MICROPY_VFS (1)
104-
#define MICROPY_PY_JSON (1)
105-
#define MICROPY_PY_RE (1)
106-
#define MICROPY_PY_BINASCII (1)
107-
#define MICROPY_PY_UCTYPES (1)
108-
#define MICROPY_PY_HEAPQ (1)
109-
#define MICROPY_PY_RANDOM (1)
11083
#ifndef MICROPY_PY_MACHINE_ADC
11184
#define MICROPY_PY_MACHINE_ADC (1)
11285
#endif
@@ -148,7 +121,6 @@
148121
#define MICROPY_PY_MACHINE_WDT (1)
149122
#define MICROPY_PY_MACHINE_WDT_INCLUDEFILE "ports/samd/machine_wdt.c"
150123
#define M 7D3D ICROPY_PY_MACHINE_WDT_TIMEOUT_MS (1)
151-
#define MICROPY_PY_PLATFORM (1)
152124
#define MICROPY_PLATFORM_VERSION "ASF4"
153125

154126
#define MP_STATE_PORT MP_STATE_VM
@@ -188,5 +160,8 @@ typedef int mp_int_t; // must be pointer size
188160
typedef unsigned mp_uint_t; // must be pointer size
189161
typedef long mp_off_t;
190162

163+
// Need an implementation of the log2 function which is not a macro.
164+
#define MP_NEED_LOG2 (1)
165+
191166
// Need to provide a declaration/definition of alloca()
192167
#include <alloca.h>

0 commit comments

Comments
 (0)
0