summaryrefslogtreecommitdiff
path: root/extmod/modbluetooth.c
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2021-07-14 14:38:38 +1000
committerDamien George <damien@micropython.org>2022-09-19 19:06:01 +1000
commit662b9761b37b054f08fe2f7c00d0fce3a418d0b0 (patch)
tree3ab168faeb26685d511bf47caa21d2eabdd86c69 /extmod/modbluetooth.c
parentcdb880789f61ee037cc7905ad75a7a9201d12ba5 (diff)
all: Make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE.
In preparation for upcoming rework of mp_obj_type_t layout. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'extmod/modbluetooth.c')
-rw-r--r--extmod/modbluetooth.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/extmod/modbluetooth.c b/extmod/modbluetooth.c
index 4cc57b3d5..2b7497e1b 100644
--- a/extmod/modbluetooth.c
+++ b/extmod/modbluetooth.c
@@ -240,16 +240,16 @@ STATIC void ringbuf_get_uuid(ringbuf_t *ringbuf, mp_obj_bluetooth_uuid_t *uuid)
#endif // !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
-const mp_obj_type_t mp_type_bluetooth_uuid = {
- { &mp_type_type },
- .name = MP_QSTR_UUID,
- .make_new = bluetooth_uuid_make_new,
- .unary_op = bluetooth_uuid_unary_op,
- .binary_op = bluetooth_uuid_binary_op,
- .locals_dict = NULL,
- .print = bluetooth_uuid_print,
- .buffer = bluetooth_uuid_get_buffer,
-};
+MP_DEFINE_CONST_OBJ_TYPE(
+ mp_type_bluetooth_uuid,
+ MP_QSTR_UUID,
+ MP_TYPE_FLAG_NONE,
+ bluetooth_uuid_make_new,
+ unary_op, bluetooth_uuid_unary_op,
+ binary_op, bluetooth_uuid_binary_op,
+ print, bluetooth_uuid_print,
+ buffer, bluetooth_uuid_get_buffer
+ );
// ----------------------------------------------------------------------------
// Bluetooth object: General
@@ -976,12 +976,13 @@ STATIC const mp_rom_map_elem_t bluetooth_ble_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(bluetooth_ble_locals_dict, bluetooth_ble_locals_dict_table);
-STATIC const mp_obj_type_t mp_type_bluetooth_ble = {
- { &mp_type_type },
- .name = MP_QSTR_BLE,
- .make_new = bluetooth_ble_make_new,
- .locals_dict = (void *)&bluetooth_ble_locals_dict,
-};
+STATIC MP_DEFINE_CONST_OBJ_TYPE(
+ mp_type_bluetooth_ble,
+ MP_QSTR_BLE,
+ MP_TYPE_FLAG_NONE,
+ bluetooth_ble_make_new,
+ locals_dict, (void *)&bluetooth_ble_locals_dict
+ );
STATIC const mp_rom_map_elem_t mp_module_bluetooth_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ubluetooth) },