Skip to content

Commit 09091ec

Browse files
committed
Enable collections deque for CIRCUITPY_FULL_BUILD
I'd like to use `collections.deque`: https://docs.circuitpython.org/en/latest/docs/library/collections.html#collections.deque ...on my RP2040-based Keybow 2040 (https://circuitpython.org/board/pimoroni_keybow2040/). For MicroPython, `collections.deque` is enabled for all `rp2` devices, because they all have `MICROPY_CONFIG_ROM_LEVEL` set to 'extra features': https://github.com/micropython/micropython/blob/cf7d962cf38db296d1ac419fc4d5302b64c59644/ports/rp2/mpconfigport.h#L44 ...which includes `MICROPY_PY_COLLECTIONS_DEQUE` (see https://github.com/micropython/micropython/blob/6bda80d81147217a1d830b99b93d2e35d372e8f9/py/mpconfig.h#L1225-L1227 ). For CircuitPython, it looks like `MICROPY_CONFIG_ROM_LEVEL` defaults to 'core' (`MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES`) and isn't updated against any of the ports, so the only port getting `collections.deque` is the `unix` port, which explcitly sets `MICROPY_PY_COLLECTIONS_DEQUE`: https://github.com/adafruit/circuitpython/blob/6925a001382d41940ea9b412b1d1ba517d9880f9/ports/unix/mpconfigport.h#L134 At Dan Halbert's suggestion... #6474 (comment) ... this commit enables `MICROPY_PY_COLLECTIONS_DEQUE` for all builds where `CIRCUITPY_FULL_BUILD` is true - which includes Raspberry Pi: https://github.com/adafruit/circuitpython/blob/6925a001382d41940ea9b412b1d1ba517d9880f9/ports/raspberrypi/mpconfigport.mk#L11 See also: * #5734 * micropython@970eedc which originally added collections.deque to MicroPython
1 parent 6925a00 commit 09091ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

py/circuitpy_mpconfig.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ typedef long mp_off_t;
226226
#ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT
227227
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD)
228228
#endif
229+
#ifndef MICROPY_PY_COLLECTIONS_DEQUE
230+
#define MICROPY_PY_COLLECTIONS_DEQUE (CIRCUITPY_FULL_BUILD)
231+
#endif
229232
#define MICROPY_PY_URE_MATCH_GROUPS (CIRCUITPY_RE)
230233
#define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_RE)
231234
#define MICROPY_PY_URE_SUB (CIRCUITPY_RE)

0 commit comments

Comments
 (0)