diff options
| author | Jim Mussared <jim.mussared@gmail.com> | 2021-07-14 14:38:38 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-09-19 19:06:01 +1000 |
| commit | 662b9761b37b054f08fe2f7c00d0fce3a418d0b0 (patch) | |
| tree | 3ab168faeb26685d511bf47caa21d2eabdd86c69 /extmod/machine_i2c.c | |
| parent | cdb880789f61ee037cc7905ad75a7a9201d12ba5 (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/machine_i2c.c')
| -rw-r--r-- | extmod/machine_i2c.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/extmod/machine_i2c.c b/extmod/machine_i2c.c index ff597b58c..7e597b791 100644 --- a/extmod/machine_i2c.c +++ b/extmod/machine_i2c.c @@ -730,13 +730,14 @@ STATIC const mp_machine_i2c_p_t mp_machine_soft_i2c_p = { .transfer = mp_machine_soft_i2c_transfer, }; -const mp_obj_type_t mp_machine_soft_i2c_type = { - { &mp_type_type }, - .name = MP_QSTR_SoftI2C, - .print = mp_machine_soft_i2c_print, - .make_new = mp_machine_soft_i2c_make_new, - .protocol = &mp_machine_soft_i2c_p, - .locals_dict = (mp_obj_dict_t *)&mp_machine_i2c_locals_dict, -}; +MP_DEFINE_CONST_OBJ_TYPE( + mp_machine_soft_i2c_type, + MP_QSTR_SoftI2C, + MP_TYPE_FLAG_NONE, + mp_machine_soft_i2c_make_new, + print, mp_machine_soft_i2c_print, + protocol, &mp_machine_soft_i2c_p, + locals_dict, (mp_obj_dict_t *)&mp_machine_i2c_locals_dict + ); #endif // MICROPY_PY_MACHINE_SOFTI2C |
