summaryrefslogtreecommitdiff
path: root/ports/esp8266/machine_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'ports/esp8266/machine_uart.c')
-rw-r--r--ports/esp8266/machine_uart.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/ports/esp8266/machine_uart.c b/ports/esp8266/machine_uart.c
index 2fe6516dc..82f518938 100644
--- a/ports/esp8266/machine_uart.c
+++ b/ports/esp8266/machine_uart.c
@@ -343,15 +343,16 @@ STATIC const mp_stream_p_t uart_stream_p = {
.is_text = false,
};
-const mp_obj_type_t pyb_uart_type = {
- { &mp_type_type },
- .name = MP_QSTR_UART,
- .print = pyb_uart_print,
- .make_new = pyb_uart_make_new,
- .getiter = mp_identity_getiter,
- .iternext = mp_stream_unbuffered_iter,
- .protocol = &uart_stream_p,
- .locals_dict = (mp_obj_dict_t *)&pyb_uart_locals_dict,
-};
+MP_DEFINE_CONST_OBJ_TYPE(
+ pyb_uart_type,
+ MP_QSTR_UART,
+ MP_TYPE_FLAG_NONE,
+ pyb_uart_make_new,
+ print, pyb_uart_print,
+ getiter, mp_identity_getiter,
+ iternext, mp_stream_unbuffered_iter,
+ protocol, &uart_stream_p,
+ locals_dict, (mp_obj_dict_t *)&pyb_uart_locals_dict
+ );
MP_REGISTER_ROOT_POINTER(byte * uart0_rxbuf);