Skip to content

Commit fc8aae0

Browse files
committed
clean up py/objmodule.c for circuitpython
1 parent 4c06915 commit fc8aae0

File tree

1 file changed

+8
-35
lines changed

1 file changed

+8
-35
lines changed

py/objmodule.c

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -200,52 +200,30 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
200200

201201
// extmod modules
202202

203-
#if MICROPY_PY_UASYNCIO
204-
#if CIRCUITPY
205-
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
206-
// TODO: move to shared-bindings/
207-
#else
203+
// Modules included in CircuitPython are registered using MP_REGISTER_MODULE,
204+
// and do not have the "u" prefix.
205+
206+
#if MICROPY_PY_UASYNCIO && !CIRCUITPY
208207
{ MP_ROM_QSTR(MP_QSTR__uasyncio), MP_ROM_PTR(&mp_module_uasyncio) },
209208
#endif
210-
#endif
211-
#if MICROPY_PY_UERRNO
212-
#if CIRCUITPY
213-
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
214-
// TODO: move to shared-bindings/
215-
#else
209+
#if MICROPY_PY_UERRNO && !CIRCUITPY
216210
{ MP_ROM_QSTR(MP_QSTR_uerrno), MP_ROM_PTR(&mp_module_uerrno) },
217211
#endif
218-
#endif
219212
#if MICROPY_PY_UCTYPES
220213
{ MP_ROM_QSTR(MP_QSTR_uctypes), MP_ROM_PTR(&mp_module_uctypes) },
221214
#endif
222215
#if MICROPY_PY_UZLIB
223216
{ MP_ROM_QSTR(MP_QSTR_uzlib), MP_ROM_PTR(&mp_module_uzlib) },
224217
#endif
225-
#if MICROPY_PY_UJSON
226-
#if CIRCUITPY
227-
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
228-
// TODO: move to shared-bindings/
229-
#else
218+
#if MICROPY_PY_UJSON && !CIRCUITPY
230219
{ MP_ROM_QSTR(MP_QSTR_ujson), MP_ROM_PTR(&mp_module_ujson) },
231220
#endif
232-
#endif
233221
#if CIRCUITPY_ULAB
234-
#if CIRCUITPY
235-
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
236-
// TODO: move to shared-bindings/
237-
#else
238222
{ MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) },
239223
#endif
240-
#endif
241-
#if MICROPY_PY_URE
242-
#if CIRCUITPY
243-
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
244-
// TODO: move to shared-bindings/
245-
#else
224+
#if MICROPY_PY_URE && !CIRCUITPY
246225
{ MP_ROM_QSTR(MP_QSTR_ure), MP_ROM_PTR(&mp_module_ure) },
247226
#endif
248-
#endif
249227
#if MICROPY_PY_UHEAPQ
250228
{ MP_ROM_QSTR(MP_QSTR_uheapq), MP_ROM_PTR(&mp_module_uheapq) },
251229
#endif
@@ -255,14 +233,9 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = {
255233
#if MICROPY_PY_UHASHLIB
256234
{ MP_ROM_QSTR(MP_QSTR_hashlib), MP_ROM_PTR(&mp_module_uhashlib) },
257235
#endif
258-
#if MICROPY_PY_UBINASCII
259-
#if CIRCUITPY
260-
// CircuitPython: Defined in MICROPY_PORT_BUILTIN_MODULES, so not defined here.
261-
// TODO: move to shared-bindings/
262-
#else
236+
#if MICROPY_PY_UBINASCII && !CIRCUITPY
263237
{ MP_ROM_QSTR(MP_QSTR_ubinascii), MP_ROM_PTR(&mp_module_ubinascii) },
264238
#endif
265-
#endif
266239
#if MICROPY_PY_URANDOM
267240
{ MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&mp_module_urandom) },
268241
#endif

0 commit comments

Comments
 (0)