summaryrefslogtreecommitdiff
path: root/ports/renesas-ra/timer.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 /ports/renesas-ra/timer.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 'ports/renesas-ra/timer.c')
-rw-r--r--ports/renesas-ra/timer.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/ports/renesas-ra/timer.c b/ports/renesas-ra/timer.c
index 1ae936525..8f7acbcda 100644
--- a/ports/renesas-ra/timer.c
+++ b/ports/renesas-ra/timer.c
@@ -410,13 +410,14 @@ STATIC const mp_rom_map_elem_t pyb_timer_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(pyb_timer_locals_dict, pyb_timer_locals_dict_table);
-const mp_obj_type_t pyb_timer_type = {
- { &mp_type_type },
- .name = MP_QSTR_Timer,
- .print = pyb_timer_print,
- .make_new = pyb_timer_make_new,
- .locals_dict = (mp_obj_dict_t *)&pyb_timer_locals_dict,
-};
+MP_DEFINE_CONST_OBJ_TYPE(
+ pyb_timer_type,
+ MP_QSTR_Timer,
+ MP_TYPE_FLAG_NONE,
+ pyb_timer_make_new,
+ locals_dict, &pyb_timer_locals_dict,
+ print, pyb_timer_print
+ );
#if defined(TIMER_CHANNEL)
/*
@@ -502,12 +503,14 @@ STATIC const mp_rom_map_elem_t pyb_timer_channel_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(pyb_timer_channel_locals_dict, pyb_timer_channel_locals_dict_table);
-STATIC const mp_obj_type_t pyb_timer_channel_type = {
- { &mp_type_type },
- .name = MP_QSTR_TimerChannel,
- .print = pyb_timer_channel_print,
- .locals_dict = (mp_obj_dict_t *)&pyb_timer_channel_locals_dict,
-};
+STATIC MP_DEFINE_CONST_OBJ_TYPE(
+ pyb_timer_channel_type,
+ MP_QSTR_TimerChannel,
+ MP_TYPE_FLAG_NONE,
+ MP_TYPE_NULL_MAKE_NEW,
+ locals_dict, &pyb_timer_channel_locals_dict,
+ print, pyb_timer_channel_print
+ );
#endif
STATIC void timer_handle_irq_channel(pyb_timer_obj_t *tim, uint8_t channel, mp_obj_t callback) {