@@ -244,13 +244,6 @@ typedef long mp_off_t;
244
244
// These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off.
245
245
// So if any are not defined in *.mk, they'll throw an error here.
246
246
247
- #if CIRCUITPY_BINASCII
248
- #define MICROPY_PY_UBINASCII CIRCUITPY_BINASCII
249
- #define BINASCII_MODULE { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) },
250
- #else
251
- #define BINASCII_MODULE
252
- #endif
253
-
254
247
#if CIRCUITPY_BOARD
255
248
#define BOARD_I2C (defined(DEFAULT_I2C_BUS_SDA) && defined(DEFAULT_I2C_BUS_SCL))
256
249
#define BOARD_SPI (defined(DEFAULT_SPI_BUS_SCK) && defined(DEFAULT_SPI_BUS_MISO) && defined(DEFAULT_SPI_BUS_MOSI))
@@ -273,15 +266,6 @@ typedef long mp_off_t;
273
266
#define CIRCUITPY_DISPLAY_LIMIT (0)
274
267
#endif
275
268
276
- #if CIRCUITPY_ERRNO
277
- #define MICROPY_PY_UERRNO (1)
278
- // Uses about 80 bytes.
279
- #define MICROPY_PY_UERRNO_ERRORCODE (1)
280
- #define ERRNO_MODULE { MP_ROM_QSTR(MP_QSTR_errno), MP_ROM_PTR(&mp_module_uerrno) },
281
- #else
282
- #define ERRNO_MODULE
283
- #endif
284
-
285
269
#if CIRCUITPY_GAMEPADSHIFT
286
270
// Scan gamepad every 32ms
287
271
#define CIRCUITPY_GAMEPAD_TICKS 0x1f
@@ -290,18 +274,6 @@ typedef long mp_off_t;
290
274
#define GAMEPAD_ROOT_POINTERS
291
275
#endif
292
276
293
- #if CIRCUITPY_JSON
294
- #define MICROPY_PY_UJSON (1)
295
- #define MICROPY_PY_IO (1)
296
- #define JSON_MODULE { MP_ROM_QSTR(MP_QSTR_json), MP_ROM_PTR(&mp_module_ujson) },
297
- #else
298
- #ifndef MICROPY_PY_IO
299
- // We don't need MICROPY_PY_IO unless someone else wants it.
300
- #define MICROPY_PY_IO (0)
301
- #endif
302
- #define JSON_MODULE
303
- #endif
304
-
305
277
#if CIRCUITPY_KEYPAD
306
278
#define KEYPAD_ROOT_POINTERS mp_obj_t keypad_scanners_linked_list;
307
279
#else
@@ -320,22 +292,31 @@ typedef long mp_off_t;
320
292
extern const struct _mp_obj_module_t nvm_module ;
321
293
#endif
322
294
323
- #if CIRCUITPY_RE
324
- #define MICROPY_PY_URE (1)
325
- #define RE_MODULE { MP_ROM_QSTR(MP_QSTR_re), MP_ROM_PTR(&mp_module_ure) },
295
+ // Following modules are implemented in either extmod or py directory.
296
+
297
+ #define MICROPY_PY_UBINASCII CIRCUITPY_BINASCII
298
+
299
+ #define MICROPY_PY_UERRNO CIRCUITPY_ERRNO
300
+ // Uses about 80 bytes.
301
+ #define MICROPY_PY_UERRNO_ERRORCODE CIRCUITPY_ERRNO
302
+
303
+ #define MICROPY_PY_URE CIRCUITPY_RE
304
+
305
+ #if CIRCUITPY_JSON
306
+ #define MICROPY_PY_UJSON (1)
307
+ #define MICROPY_PY_IO (1)
326
308
#else
327
- #define RE_MODULE
309
+ #ifndef MICROPY_PY_IO
310
+ // We don't need MICROPY_PY_IO unless someone else wants it.
311
+ #define MICROPY_PY_IO (0)
312
+ #endif
328
313
#endif
329
314
330
- #if defined( CIRCUITPY_ULAB ) && CIRCUITPY_ULAB
315
+ #if CIRCUITPY_ULAB
331
316
// ulab requires reverse special methods
332
317
#if defined(MICROPY_PY_REVERSE_SPECIAL_METHODS ) && !MICROPY_PY_REVERSE_SPECIAL_METHODS
333
318
#error "ulab requires MICROPY_PY_REVERSE_SPECIAL_METHODS"
334
319
#endif
335
- #define ULAB_MODULE \
336
- { MP_ROM_QSTR(MP_QSTR_ulab), MP_ROM_PTR(&ulab_user_cmodule) },
337
- #else
338
- #define ULAB_MODULE
339
320
#endif
340
321
341
322
// Define certain native modules with weak links so they can be replaced with Python
@@ -355,11 +336,7 @@ extern const struct _mp_obj_module_t nvm_module;
355
336
// Some of these definitions will be blank depending on what is turned on and off.
356
337
// Some are omitted because they're in MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS above.
357
338
358
- #define MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS \
359
- BINASCII_MODULE \
360
- ERRNO_MODULE \
361
- JSON_MODULE \
362
- RE_MODULE \
339
+ #define MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS
363
340
364
341
// The following modules are defined in their respective __init__.c file in the
365
342
// shared-bindings directory using MP_REGISTER_MODULE.
0 commit comments