Skip to content

Commit 9002f35

Browse files
committed
Convert more modules to use MP_REGISTER_MODULE
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 #5183.
1 parent fbb005b commit 9002f35

File tree

22 files changed

+120
-238
lines changed

22 files changed

+120
-238
lines changed

py/circuitpy_mpconfig.h

Lines changed: 77 additions & 238 deletions
Large diffs are not rendered by default.

shared-bindings/_eve/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,3 +1105,5 @@ const mp_obj_module_t _eve_module = {
11051105
.base = { &mp_type_module },
11061106
.globals = (mp_obj_dict_t *)&mp_module__eve_globals,
11071107
};
1108+
1109+
MP_REGISTER_MODULE(MP_QSTR__eve, _eve_module, CIRCUITPY__EVE);

shared-bindings/_pew/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ const mp_obj_module_t pew_module = {
6363
.base = { &mp_type_module },
6464
.globals = (mp_obj_dict_t *)&pew_module_globals,
6565
};
66+
67+
MP_REGISTER_MODULE(MP_QSTR__pew, pew_module, CIRCUITPY_PEW);

shared-bindings/aesio/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ const mp_obj_module_t aesio_module = {
6363
.base = {&mp_type_module},
6464
.globals = (mp_obj_dict_t *)&aesio_module_globals,
6565
};
66+
67+
MP_REGISTER_MODULE(MP_QSTR_aesio, aesio_module, CIRCUITPY_AESIO);

shared-bindings/alarm/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,5 @@ extern void port_idle_until_interrupt(void);
248248
MP_WEAK void common_hal_alarm_pretending_deep_sleep(void) {
249249
port_idle_until_interrupt();
250250
}
251+
252+
MP_REGISTER_MODULE(MP_QSTR_alarm, alarm_module, CIRCUITPY_ALARM);

shared-bindings/audiopwmio/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ const mp_obj_module_t audiopwmio_module = {
5757
.base = { &mp_type_module },
5858
.globals = (mp_obj_dict_t *)&audiopwmio_module_globals,
5959
};
60+
61+
MP_REGISTER_MODULE(MP_QSTR_audiopwmio, audiopwmio_module, CIRCUITPY_AUDIOPWMIO);

shared-bindings/bitops/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,5 @@ const mp_obj_module_t bitops_module = {
9999
.base = { &mp_type_module },
100100
.globals = (mp_obj_dict_t *)&bitops_module_globals,
101101
};
102+
103+
MP_REGISTER_MODULE(MP_QSTR_bitops, bitops_module, CIRCUITPY_BITOPS);

shared-bindings/camera/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ const mp_obj_module_t camera_module = {
4848
.base = { &mp_type_module },
4949
.globals = (mp_obj_dict_t *)&camera_module_globals,
5050
};
51+
52+
MP_REGISTER_MODULE(MP_QSTR_camera, camera_module, CIRCUITPY_CAMERA);

shared-bindings/canio/__init__.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ MAKE_PRINTER(canio, canio_bus_state);
108108
MAKE_ENUM_TYPE(canio, BusState, canio_bus_state);
109109

110110
STATIC const mp_rom_map_elem_t canio_module_globals_table[] = {
111+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_canio) },
111112
{ MP_ROM_QSTR(MP_QSTR_BusState), MP_ROM_PTR(&canio_bus_state_type) },
112113
{ MP_ROM_QSTR(MP_QSTR_CAN), MP_ROM_PTR(&canio_can_type) },
113114
{ MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) },
@@ -123,3 +124,5 @@ const mp_obj_module_t canio_module = {
123124
.base = { &mp_type_module },
124125
.globals = (mp_obj_dict_t *)&canio_module_globals,
125126
};
127+
128+
MP_REGISTER_MODULE(MP_QSTR_canio, canio_module, CIRCUITPY_CANIO);

shared-bindings/dualbank/__init__.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,5 @@ const mp_obj_module_t dualbank_module = {
113113
.base = { &mp_type_module },
114114
.globals = (mp_obj_dict_t *)&dualbank_module_globals,
115115
};
116+
117+
MP_REGISTER_MODULE(MP_QSTR_dualbank, dualbank_module, CIRCUITPY_DUALBANK);

0 commit comments

Comments
 (0)