summaryrefslogtreecommitdiff
path: root/ports/zephyr/machine_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/zephyr/machine_uart.c')
-rw-r--r--ports/zephyr/machine_uart.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/ports/zephyr/machine_uart.c b/ports/zephyr/machine_uart.c
index 3520795c5..3f5df7465 100644
--- a/ports/zephyr/machine_uart.c
+++ b/ports/zephyr/machine_uart.c
@@ -154,13 +154,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
+ );