Skip to content

Commit

Permalink
Convert more modules to use MP_REGISTER_MODULE
Browse files Browse the repository at this point in the history
Convert _eve, _pew, aesio, alarm, audiopwmio, bitops, camera, canio, dualbank, gnss, i2cperipheral, imagecapture, ipaddress, memorymonitor, sdioio, socketpool, ssl, uheap, ustack, watchdog, and wifi modules to use MP_REGISTER_MODULE.

Related to adafruit#5183.
  • Loading branch information
capellini committed Sep 1, 2021
1 parent fbb005b commit 9002f35
Show file tree
Hide file tree
Showing 22 changed files with 120 additions and 238 deletions.
315 changes: 77 additions & 238 deletions py/circuitpy_mpconfig.h

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions shared-bindings/_eve/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,3 +1105,5 @@ const mp_obj_module_t _eve_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module__eve_globals,
};

MP_REGISTER_MODULE(MP_QSTR__eve, _eve_module, CIRCUITPY__EVE);
2 changes: 2 additions & 0 deletions shared-bindings/_pew/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ const mp_obj_module_t pew_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&pew_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR__pew, pew_module, CIRCUITPY_PEW);
2 changes: 2 additions & 0 deletions shared-bindings/aesio/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,5 @@ const mp_obj_module_t aesio_module = {
.base = {&mp_type_module},
.globals = (mp_obj_dict_t *)&aesio_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_aesio, aesio_module, CIRCUITPY_AESIO);
2 changes: 2 additions & 0 deletions shared-bindings/alarm/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,5 @@ extern void port_idle_until_interrupt(void);
MP_WEAK void common_hal_alarm_pretending_deep_sleep(void) {
port_idle_until_interrupt();
}

MP_REGISTER_MODULE(MP_QSTR_alarm, alarm_module, CIRCUITPY_ALARM);
2 changes: 2 additions & 0 deletions shared-bindings/audiopwmio/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ const mp_obj_module_t audiopwmio_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&audiopwmio_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_audiopwmio, audiopwmio_module, CIRCUITPY_AUDIOPWMIO);
2 changes: 2 additions & 0 deletions shared-bindings/bitops/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ const mp_obj_module_t bitops_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&bitops_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_bitops, bitops_module, CIRCUITPY_BITOPS);
2 changes: 2 additions & 0 deletions shared-bindings/camera/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ const mp_obj_module_t camera_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&camera_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_camera, camera_module, CIRCUITPY_CAMERA);
3 changes: 3 additions & 0 deletions shared-bindings/canio/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ MAKE_PRINTER(canio, canio_bus_state);
MAKE_ENUM_TYPE(canio, BusState, canio_bus_state);

STATIC const mp_rom_map_elem_t canio_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_canio) },
{ MP_ROM_QSTR(MP_QSTR_BusState), MP_ROM_PTR(&canio_bus_state_type) },
{ MP_ROM_QSTR(MP_QSTR_CAN), MP_ROM_PTR(&canio_can_type) },
{ MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) },
Expand All @@ -123,3 +124,5 @@ const mp_obj_module_t canio_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&canio_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_canio, canio_module, CIRCUITPY_CANIO);
2 changes: 2 additions & 0 deletions shared-bindings/dualbank/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@ const mp_obj_module_t dualbank_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&dualbank_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_dualbank, dualbank_module, CIRCUITPY_DUALBANK);
2 changes: 2 additions & 0 deletions shared-bindings/gnss/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ const mp_obj_module_t gnss_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&gnss_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_gnss, gnss_module, CIRCUITPY_GNSS);
2 changes: 2 additions & 0 deletions shared-bindings/i2cperipheral/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,5 @@ const mp_obj_module_t i2cperipheral_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&i2cperipheral_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_i2cperipheral, i2cperipheral_module, CIRCUITPY_I2CPERIPHERAL);
2 changes: 2 additions & 0 deletions shared-bindings/imagecapture/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ const mp_obj_module_t imagecapture_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&imagecapture_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_imagecapture, imagecapture_module, CIRCUITPY_IMAGECAPTURE);
2 changes: 2 additions & 0 deletions shared-bindings/ipaddress/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ const mp_obj_module_t ipaddress_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&ipaddress_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ipaddress, ipaddress_module, CIRCUITPY_IPADDRESS);
2 changes: 2 additions & 0 deletions shared-bindings/memorymonitor/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ const mp_obj_module_t memorymonitor_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&memorymonitor_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_memorymonitor, memorymonitor_module, CIRCUITPY_MEMORYMONITOR);
2 changes: 2 additions & 0 deletions shared-bindings/sdioio/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ const mp_obj_module_t sdioio_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&sdioio_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_sdio, sdioio_module, CIRCUITPY_SDIOIO);
2 changes: 2 additions & 0 deletions shared-bindings/socketpool/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ const mp_obj_module_t socketpool_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&socketpool_globals,
};

MP_REGISTER_MODULE(MP_QSTR_socketpool, socketpool_module, CIRCUITPY_SOCKETPOOL);
2 changes: 2 additions & 0 deletions shared-bindings/ssl/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ const mp_obj_module_t ssl_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&ssl_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ssl, ssl_module, CIRCUITPY_SSL);
2 changes: 2 additions & 0 deletions shared-bindings/uheap/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ const mp_obj_module_t uheap_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&uheap_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_uheap, uheap_module, CIRCUITPY_UHEAP);
2 changes: 2 additions & 0 deletions shared-bindings/ustack/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ const mp_obj_module_t ustack_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&ustack_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_ustack, ustack_module, CIRCUITPY_USTACK);
2 changes: 2 additions & 0 deletions shared-bindings/watchdog/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ const mp_obj_module_t watchdog_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&watchdog_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_watchdog, watchdog_module, CIRCUITPY_WATCHDOG);
2 changes: 2 additions & 0 deletions shared-bindings/wifi/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ const mp_obj_module_t wifi_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&wifi_module_globals,
};

MP_REGISTER_MODULE(MP_QSTR_wifi, wifi_module, CIRCUITPY_WIFI);

0 comments on commit 9002f35

Please sign in to comment.