Skip to content

Commit 46e833b

Browse files
committed
qemu-arm/mpconfigport: Use MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES.
This simplifes the port configuration. It enables quite a few new features, including the `math` and `cmath` modules, adding about 20k to the firmware size. Signed-off-by: Damien George <[email protected]>
1 parent 4068745 commit 46e833b

File tree

1 file changed

+13
-28
lines changed

1 file changed

+13
-28
lines changed

ports/qemu-arm/mpconfigport.h

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// options to control how MicroPython is built
44

5-
#define MICROPY_ALLOC_PATH_MAX (512)
5+
#define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES)
66

77
#if defined(__ARM_ARCH_ISA_ARM)
88
#define MICROPY_EMIT_ARM (1)
@@ -15,42 +15,24 @@
1515

1616
#define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
1717
#define MICROPY_MEM_STATS (1)
18-
#define MICROPY_DEBUG_PRINTERS (0)
1918
#define MICROPY_ENABLE_GC (1)
20-
#define MICROPY_STACK_CHECK (1)
19+
#define MICROPY_KBD_EXCEPTION (0)
2120
#define MICROPY_HELPER_REPL (0)
22-
#define MICROPY_HELPER_LEXER_UNIX (0)
23-
#define MICROPY_ENABLE_SOURCE_LINE (1)
2421
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
2522
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_FLOAT)
26-
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
2723
#define MICROPY_WARNINGS (1)
28-
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
29-
#define MICROPY_PY_REVERSE_SPECIAL_METHODS (1)
30-
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
31-
#define MICROPY_PY_BUILTINS_BYTES_HEX (1)
32-
#define MICROPY_PY_BUILTINS_FROZENSET (1)
33-
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
34-
#define MICROPY_PY_BUILTINS_POW3 (1)
35-
#define MICROPY_PY_IO (1)
36-
#define MICROPY_PY_SYS_EXIT (1)
37-
#define MICROPY_PY_SYS_MAXSIZE (1)
24+
#define MICROPY_PY_BUILTINS_INPUT (0)
25+
#define MICROPY_PY_BUILTINS_HELP (0)
26+
#define MICROPY_PY_IO_IOBASE (0)
3827
#define MICROPY_PY_SYS_PLATFORM "qemu-arm"
39-
#define MICROPY_PY_ERRNO (1)
40-
#define MICROPY_PY_BINASCII (1)
41-
#define MICROPY_PY_RANDOM (1)
42-
#define MICROPY_PY_UCTYPES (1)
43-
#define MICROPY_PY_DEFLATE (1)
44-
#define MICROPY_PY_JSON (1)
45-
#define MICROPY_PY_OS (1)
46-
#define MICROPY_PY_RE (1)
47-
#define MICROPY_PY_HEAPQ (1)
48-
#define MICROPY_PY_HASHLIB (1)
28+
#define MICROPY_PY_SYS_STDFILES (0)
29+
#define MICROPY_PY_SYS_STDIO_BUFFER (0)
30+
#define MICROPY_PY_SELECT (0)
31+
#define MICROPY_PY_TIME (0)
32+
#define MICROPY_PY_ASYNCIO (0)
4933
#define MICROPY_PY_MACHINE (1)
5034
#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/qemu-arm/modmachine.c"
5135
#define MICROPY_PY_MACHINE_PIN_BASE (1)
52-
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
53-
#define MICROPY_USE_INTERNAL_PRINTF (1)
5436
#define MICROPY_VFS (1)
5537

5638
// type definitions for the specific machine
@@ -67,6 +49,9 @@ typedef long mp_off_t;
6749
// We need to provide a declaration/definition of alloca()
6850
#include <alloca.h>
6951

52+
// We need an implementation of the log2 function which is not a macro.
53+
#define MP_NEED_LOG2 (1)
54+
7055
#ifdef TEST
7156
#include "shared/upytesthelper/upytesthelper.h"
7257
#undef MP_PLAT_PRINT_STRN

0 commit comments

Comments
 (0)