@@ -280,19 +280,8 @@ extern const struct _mp_obj_module_t audiopwmio_module;
280
280
#define BINASCII_MODULE
281
281
#endif
282
282
283
- #if CIRCUITPY_BITBANGIO
284
- #define BITBANGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module },
285
- extern const struct _mp_obj_module_t bitbangio_module ;
286
- #else
287
- #define BITBANGIO_MODULE
288
- #endif
289
-
290
- #if CIRCUITPY_BITMAPTOOLS
291
- #define BITMAPTOOLS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitmaptools), (mp_obj_t)&bitmaptools_module },
292
- extern const struct _mp_obj_module_t bitmaptools_module ;
293
- #else
294
- #define BITMAPTOOLS_MODULE
295
- #endif
283
+ // CIRCUITPY_BITBANGIO uses MP_REGISTER_MODULE
284
+ // CIRCUITPY_BITMAPTOOLS uses MP_REGISTER_MODULE
296
285
297
286
#if CIRCUITPY_BITOPS
298
287
extern const struct _mp_obj_module_t bitops_module ;
@@ -301,17 +290,10 @@ extern const struct _mp_obj_module_t bitops_module;
301
290
#define BITOPS_MODULE
302
291
#endif
303
292
304
- #if CIRCUITPY_BLEIO
305
- #define BLEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__bleio), (mp_obj_t)&bleio_module },
306
- extern const struct _mp_obj_module_t bleio_module ;
307
- #else
308
- #define BLEIO_MODULE
309
- #endif
293
+ // CIRCUITPY_BLEIO uses MP_REGISTER_MODULE
294
+ // CIRCUITPY_BOARD uses MP_REGISTER_MODULE
310
295
311
296
#if CIRCUITPY_BOARD
312
- #define BOARD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module },
313
- extern const struct _mp_obj_module_t board_module ;
314
-
315
297
#define BOARD_I2C (defined(DEFAULT_I2C_BUS_SDA) && defined(DEFAULT_I2C_BUS_SCL))
316
298
#define BOARD_SPI (defined(DEFAULT_SPI_BUS_SCK) && defined(DEFAULT_SPI_BUS_MISO) && defined(DEFAULT_SPI_BUS_MOSI))
317
299
#define BOARD_UART (defined(DEFAULT_UART_BUS_RX) && defined(DEFAULT_UART_BUS_TX))
@@ -325,18 +307,11 @@ extern const struct _mp_obj_module_t board_module;
325
307
#endif
326
308
327
309
#else
328
- #define BOARD_MODULE
329
310
#define BOARD_UART_ROOT_POINTER
330
311
#endif
331
312
332
313
// CIRCUITPY_BUSDEVICE (adafruit_bus_device_module) uses MP_REGISTER_MODULE
333
-
334
- #if CIRCUITPY_BUSIO
335
- extern const struct _mp_obj_module_t busio_module ;
336
- #define BUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module },
337
- #else
338
- #define BUSIO_MODULE
339
- #endif
314
+ // CIRCUITPY_BUSIO uses MP_REGISTER_MODULE
340
315
341
316
#if CIRCUITPY_CAMERA
342
317
extern const struct _mp_obj_module_t camera_module ;
@@ -352,20 +327,8 @@ extern const struct _mp_obj_module_t canio_module;
352
327
#define CANIO_MODULE
353
328
#endif
354
329
355
- #if CIRCUITPY_COUNTIO
356
- extern const struct _mp_obj_module_t countio_module ;
357
- #define COUNTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_countio), (mp_obj_t)&countio_module },
358
- #else
359
- #define COUNTIO_MODULE
360
- #endif
361
-
362
- #if CIRCUITPY_DIGITALIO
363
- extern const struct _mp_obj_module_t digitalio_module ;
364
- #define DIGITALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module },
365
- #else
366
- #define DIGITALIO_MODULE
367
- #endif
368
-
330
+ // CIRCUITPY_COUNTIO uses MP_REGISTER_MODULE
331
+ // CIRCUITPY_DIGITALIO uses MP_REGISTER_MODULE
369
332
// CIRCUITPY_DISPLAYIO uses MP_REGISTER_MODULE
370
333
// CIRCUITPY_TERMINALIO uses MP_REGISTER_MODULE
371
334
// CIRCUITPY_FONTIO uses MP_REGISTER_MODULE
@@ -409,12 +372,7 @@ extern const struct _mp_obj_module_t _eve_module;
409
372
#define _EVE_MODULE
410
373
#endif
411
374
412
- #if CIRCUITPY_FRAMEBUFFERIO
413
- extern const struct _mp_obj_module_t framebufferio_module ;
414
- #define FRAMEBUFFERIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_framebufferio), (mp_obj_t)&framebufferio_module },
415
- #else
416
- #define FRAMEBUFFERIO_MODULE
417
- #endif
375
+ // CIRCUITPY_FRAMEBUFFERIO uses MP_REGISTER_MODULE
418
376
419
377
#if CIRCUITPY_VECTORIO
420
378
extern const struct _mp_obj_module_t vectorio_module ;
@@ -423,19 +381,8 @@ extern const struct _mp_obj_module_t vectorio_module;
423
381
#define VECTORIO_MODULE
424
382
#endif
425
383
426
- #if CIRCUITPY_FREQUENCYIO
427
- extern const struct _mp_obj_module_t frequencyio_module ;
428
- #define FREQUENCYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_frequencyio), (mp_obj_t)&frequencyio_module },
429
- #else
430
- #define FREQUENCYIO_MODULE
431
- #endif
432
-
433
- #if CIRCUITPY_GAMEPADSHIFT
434
- extern const struct _mp_obj_module_t gamepadshift_module ;
435
- #define GAMEPADSHIFT_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gamepadshift),(mp_obj_t)&gamepadshift_module },
436
- #else
437
- #define GAMEPADSHIFT_MODULE
438
- #endif
384
+ // CIRCUITPY_FREQUENCYIO uses MP_REGISTER_MODULE
385
+ // CIRCUITPY_GAMEPADSHIFT uses MP_REGISTER_MODULE
439
386
440
387
#if CIRCUITPY_GAMEPADSHIFT
441
388
// Scan gamepad every 32ms
@@ -445,12 +392,7 @@ extern const struct _mp_obj_module_t gamepadshift_module;
445
392
#define GAMEPAD_ROOT_POINTERS
446
393
#endif
447
394
448
- #if CIRCUITPY_GETPASS
449
- extern const struct _mp_obj_module_t getpass_module ;
450
- #define GETPASS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_getpass), (mp_obj_t)&getpass_module },
451
- #else
452
- #define GETPASS_MODULE
453
- #endif
395
+ // CIRCUITPY_GETPASS uses MP_REGISTER_MODULE
454
396
455
397
#if CIRCUITPY_GNSS
456
398
extern const struct _mp_obj_module_t gnss_module ;
@@ -492,29 +434,15 @@ extern const struct _mp_obj_module_t ipaddress_module;
492
434
#define JSON_MODULE
493
435
#endif
494
436
437
+ // CIRCUITPY_KEYPAD uses MP_REGISTER_MODULE
438
+
495
439
#if CIRCUITPY_KEYPAD
496
- extern const struct _mp_obj_module_t keypad_module ;
497
- #define KEYPAD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_keypad), (mp_obj_t)&keypad_module },
498
440
#define KEYPAD_ROOT_POINTERS mp_obj_t keypad_scanners_linked_list;
499
441
#else
500
- #define KEYPAD_MODULE
501
442
#define KEYPAD_ROOT_POINTERS
502
443
#endif
503
444
504
- #if CIRCUITPY_GAMEPADSHIFT
505
- // Scan gamepadshift every 32ms
506
- #define CIRCUITPY_GAMEPAD_TICKS 0x1f
507
- #define GAMEPAD_ROOT_POINTERS mp_obj_t gamepad_singleton;
508
- #else
509
- #define GAMEPAD_ROOT_POINTERS
510
- #endif
511
-
512
- #if CIRCUITPY_MATH
513
- extern const struct _mp_obj_module_t math_module ;
514
- #define MATH_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module },
515
- #else
516
- #define MATH_MODULE
517
- #endif
445
+ // CIRCUITPY_MATH uses MP_REGISTER_MODULE
518
446
519
447
#if CIRCUITPY_MEMORYMONITOR
520
448
extern const struct _mp_obj_module_t memorymonitor_module ;
@@ -526,12 +454,7 @@ extern const struct _mp_obj_module_t memorymonitor_module;
526
454
#define MEMORYMONITOR_ROOT_POINTERS
527
455
#endif
528
456
529
- #if CIRCUITPY_MICROCONTROLLER
530
- extern const struct _mp_obj_module_t microcontroller_module ;
531
- #define MICROCONTROLLER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)µcontroller_module },
532
- #else
533
- #define MICROCONTROLLER_MODULE
534
- #endif
457
+ // CIRCUITPY_MICROCONTROLLER uses MP_REGISTER_MODULE
535
458
536
459
#if CIRCUITPY_NEOPIXEL_WRITE
537
460
extern const struct _mp_obj_module_t neopixel_write_module ;
@@ -803,12 +726,7 @@ extern const struct _mp_obj_module_t wifi_module;
803
726
#define WIFI_MODULE
804
727
#endif
805
728
806
- #if CIRCUITPY_MSGPACK
807
- extern const struct _mp_obj_module_t msgpack_module ;
808
- #define MSGPACK_MODULE { MP_ROM_QSTR(MP_QSTR_msgpack), MP_ROM_PTR(&msgpack_module) },
809
- #else
810
- #define MSGPACK_MODULE
811
- #endif
729
+ // CIRCUITPY_MSGPACK uses MP_REGISTER_MODULE
812
730
813
731
// Define certain native modules with weak links so they can be replaced with Python
814
732
// implementations. This list may grow over time.
@@ -833,35 +751,20 @@ extern const struct _mp_obj_module_t msgpack_module;
833
751
ALARM_MODULE \
834
752
AUDIOPWMIO_MODULE \
835
753
BINASCII_MODULE \
836
- BITBANGIO_MODULE \
837
- BITMAPTOOLS_MODULE \
838
754
BITOPS_MODULE \
839
- BLEIO_MODULE \
840
- BOARD_MODULE \
841
- BUSIO_MODULE \
842
755
CAMERA_MODULE \
843
756
CANIO_MODULE \
844
- COUNTIO_MODULE \
845
- DIGITALIO_MODULE \
846
757
DUALBANK_MODULE \
847
758
VECTORIO_MODULE \
848
759
ERRNO_MODULE \
849
760
ESPIDF_MODULE \
850
761
_EVE_MODULE \
851
- FRAMEBUFFERIO_MODULE \
852
- FREQUENCYIO_MODULE \
853
- GAMEPADSHIFT_MODULE \
854
- GETPASS_MODULE \
855
762
GNSS_MODULE \
856
763
I2CPERIPHERAL_MODULE \
857
764
IPADDRESS_MODULE \
858
765
IMAGECAPTURE_MODULE \
859
766
JSON_MODULE \
860
- KEYPAD_MODULE \
861
- MATH_MODULE \
862
767
MEMORYMONITOR_MODULE \
863
- MICROCONTROLLER_MODULE \
864
- MSGPACK_MODULE \
865
768
NEOPIXEL_WRITE_MODULE \
866
769
ONEWIREIO_MODULE \
867
770
PEW_MODULE \
0 commit comments