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_spi.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_spi.c')
| -rw-r--r-- | extmod/machine_spi.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/extmod/machine_spi.c b/extmod/machine_spi.c index ba533b2a6..43148c9c8 100644 --- a/extmod/machine_spi.c +++ b/extmod/machine_spi.c @@ -251,13 +251,14 @@ const mp_machine_spi_p_t mp_machine_soft_spi_p = { .transfer = mp_machine_soft_spi_transfer, }; -const mp_obj_type_t mp_machine_soft_spi_type = { - { &mp_type_type }, - .name = MP_QSTR_SoftSPI, - .print = mp_machine_soft_spi_print, - .make_new = mp_machine_soft_spi_make_new, - .protocol = &mp_machine_soft_spi_p, - .locals_dict = (mp_obj_dict_t *)&mp_machine_spi_locals_dict, -}; +MP_DEFINE_CONST_OBJ_TYPE( + mp_machine_soft_spi_type, + MP_QSTR_SoftSPI, + MP_TYPE_FLAG_NONE, + mp_machine_soft_spi_make_new, + print, mp_machine_soft_spi_print, + protocol, &mp_machine_soft_spi_p, + locals_dict, (mp_obj_dict_t *)&mp_machine_spi_locals_dict + ); #endif // MICROPY_PY_MACHINE_SOFTSPI |
