summaryrefslogtreecommitdiff
path: root/ports/esp8266/modmachine.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/esp8266/modmachine.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/esp8266/modmachine.c')
-rw-r--r--ports/esp8266/modmachine.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ports/esp8266/modmachine.c b/ports/esp8266/modmachine.c
index 1dd87b9af..2bb2c7bd7 100644
--- a/ports/esp8266/modmachine.c
+++ b/ports/esp8266/modmachine.c
@@ -337,13 +337,14 @@ STATIC const mp_rom_map_elem_t esp_timer_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(esp_timer_locals_dict, esp_timer_locals_dict_table);
-const mp_obj_type_t esp_timer_type = {
- { &mp_type_type },
- .name = MP_QSTR_Timer,
- .print = esp_timer_print,
- .make_new = esp_timer_make_new,
- .locals_dict = (mp_obj_dict_t *)&esp_timer_locals_dict,
-};
+MP_DEFINE_CONST_OBJ_TYPE(
+ esp_timer_type,
+ MP_QSTR_Timer,
+ MP_TYPE_FLAG_NONE,
+ esp_timer_make_new,
+ print, esp_timer_print,
+ locals_dict, (mp_obj_dict_t *)&esp_timer_locals_dict
+ );
// this bit is unused in the Xtensa PS register
#define ETS_LOOP_ITER_BIT (12)