summaryrefslogtreecommitdiff
path: root/ports/esp32/machine_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp32/machine_uart.c')
-rw-r--r--ports/esp32/machine_uart.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/ports/esp32/machine_uart.c b/ports/esp32/machine_uart.c
index 724459128..9df16ae41 100644
--- a/ports/esp32/machine_uart.c
+++ b/ports/esp32/machine_uart.c
@@ -530,13 +530,14 @@ STATIC const mp_stream_p_t uart_stream_p = {
.is_text = false,
};
-const mp_obj_type_t machine_uart_type = {
- { &mp_type_type },
- .name = MP_QSTR_UART,
- .print = machine_uart_print,
- .make_new = machine_uart_make_new,
- .getiter = mp_identity_getiter,
- .iternext = mp_stream_unbuffered_iter,
- .protocol = &uart_stream_p,
- .locals_dict = (mp_obj_dict_t *)&machine_uart_locals_dict,
-};
+MP_DEFINE_CONST_OBJ_TYPE(
+ machine_uart_type,
+ MP_QSTR_UART,
+ MP_TYPE_FLAG_NONE,
+ machine_uart_make_new,
+ print, machine_uart_print,
+ getiter, mp_identity_getiter,
+ iternext, mp_stream_unbuffered_iter,
+ protocol, &uart_stream_p,
+ locals_dict, (mp_obj_dict_t *)&machine_uart_locals_dict
+ );