From e2d4db96dac0d8316287e5fc60d3eeb57b28f259 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 1 Jul 2022 14:55:33 -0500 Subject: [PATCH] esp8266: Use MP_REGISTER_ROOT_POINTER(). This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root pointers in the esp2866 port. Signed-off-by: David Lechner --- ports/esp8266/machine_pin.c | 2 ++ ports/esp8266/machine_uart.c | 2 ++ ports/esp8266/mpconfigport.h | 4 ---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/esp8266/machine_pin.c b/ports/esp8266/machine_pin.c index 419ee87a73..8171b8a8a3 100644 --- a/ports/esp8266/machine_pin.c +++ b/ports/esp8266/machine_pin.c @@ -515,3 +515,5 @@ STATIC const mp_obj_type_t pin_irq_type = { .call = pin_irq_call, .locals_dict = (mp_obj_dict_t *)&pin_irq_locals_dict, }; + +MP_REGISTER_ROOT_POINTER(mp_obj_t pin_irq_handler[16]); diff --git a/ports/esp8266/machine_uart.c b/ports/esp8266/machine_uart.c index b774419d2d..4e88eee162 100644 --- a/ports/esp8266/machine_uart.c +++ b/ports/esp8266/machine_uart.c @@ -329,3 +329,5 @@ const mp_obj_type_t pyb_uart_type = { .protocol = &uart_stream_p, .locals_dict = (mp_obj_dict_t *)&pyb_uart_locals_dict, }; + +MP_REGISTER_ROOT_POINTER(byte * uart0_rxbuf); diff --git a/ports/esp8266/mpconfigport.h b/ports/esp8266/mpconfigport.h index 3f1db723a5..779767311c 100644 --- a/ports/esp8266/mpconfigport.h +++ b/ports/esp8266/mpconfigport.h @@ -147,10 +147,6 @@ extern const struct _mp_print_t mp_debug_print; #define MP_STATE_PORT MP_STATE_VM -#define MICROPY_PORT_ROOT_POINTERS \ - mp_obj_t pin_irq_handler[16]; \ - byte *uart0_rxbuf; \ - // We need an implementation of the log2 function which is not a macro #define MP_NEED_LOG2 (1)