Skip to content

Commit 7904bb9

Browse files
committed
bricks/_common/mpconfigport: Drop MICROPY_MODULE_BUILTIN_INIT on small hubs.
This is only used in the random module. The color module says it uses it, but this is not the case.
1 parent 560988e commit 7904bb9

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

bricks/_common/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
#define MICROPY_PY_SYS_STDIO_FLUSH (PYBRICKS_OPT_EXTRA_LEVEL1)
100100
#define MICROPY_PY_RANDOM_EXTRA_FUNCS (PYBRICKS_OPT_EXTRA_LEVEL1)
101101
#define MICROPY_PY_RANDOM_SEED_INIT_FUNC ({ extern uint32_t pbdrv_clock_get_us(void); pbdrv_clock_get_us(); })
102-
#define MICROPY_MODULE_BUILTIN_INIT (1)
102+
#define MICROPY_MODULE_BUILTIN_INIT (MICROPY_PY_RANDOM)
103103
#define MICROPY_CPYTHON_COMPAT (0)
104104
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_NONE)
105105
#if PYBRICKS_OPT_FLOAT

pybricks/parameters/pb_type_color.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55

66
#if PYBRICKS_PY_PARAMETERS
77

8-
#if !MICROPY_MODULE_BUILTIN_INIT
9-
// The color dictionary is built in the module __init__, so we get a segfault
10-
// if this is not enabled.
11-
#error "pybricks.parameters.Color requires that MICROPY_MODULE_BUILTIN_INIT is enabled"
12-
#endif
13-
148
#include <pbio/color.h>
159
#include <pbio/int_math.h>
1610

0 commit comments

Comments
 (0)