renesas-ra: Use MP_REGISTER_ROOT_POINTER().

This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root
pointers in the renesas-ra port.

Signed-off-by: David Lechner <david@pybricks.com>
This commit is contained in:
David Lechner 2022-07-01 15:24:28 -05:00 committed by Damien George
parent f8805e2416
commit 575fa61c6d
7 changed files with 12 additions and 17 deletions

View File

@ -399,3 +399,5 @@ void extint_init0(void) {
MP_STATE_PORT(pyb_extint_callback)[i] = mp_const_none;
}
}
MP_REGISTER_ROOT_POINTER(mp_obj_t pyb_extint_callback[PYB_EXTI_NUM_VECTORS]);

View File

@ -581,3 +581,5 @@ const mp_obj_type_t machine_uart_type = {
.protocol = &uart_stream_p,
.locals_dict = (mp_obj_dict_t *)&machine_uart_locals_dict,
};
MP_REGISTER_ROOT_POINTER(struct _machine_uart_obj_t *machine_uart_obj_all[MICROPY_HW_MAX_UART + MICROPY_HW_MAX_LPUART]);

View File

@ -397,3 +397,5 @@ soft_reset_exit:
goto soft_reset;
}
MP_REGISTER_ROOT_POINTER(mp_obj_t pyb_config_main);

View File

@ -168,23 +168,6 @@
#endif
#define MICROPY_PORT_ROOT_POINTERS \
mp_obj_t pyb_config_main; \
\
mp_obj_t pyb_switch_callback; \
\
mp_obj_t pyb_extint_callback[PYB_EXTI_NUM_VECTORS]; \
\
/* pointers to all Timer objects (if they have been created) */ \
struct _pyb_timer_obj_t *pyb_timer_obj_all[MICROPY_HW_MAX_TIMER]; \
\
/* stdio is repeated on this UART object if it's not null */ \
struct _machine_uart_obj_t *pyb_stdio_uart; \
\
/* pointers to all UART objects (if they have been created) */ \
struct _machine_uart_obj_t *machine_uart_obj_all[MICROPY_HW_MAX_UART + MICROPY_HW_MAX_LPUART]; \
\
/* root pointers for sub-systems */ \
\
/* root pointers defined by a board */ \
MICROPY_BOARD_ROOT_POINTERS \

View File

@ -118,3 +118,5 @@ void mp_hal_get_mac_ascii(int idx, size_t chr_off, size_t chr_len, char *dest) {
*dest++ = hexchr[mac[chr_off >> 1] >> (4 * (1 - (chr_off & 1))) & 0xf];
}
}
MP_REGISTER_ROOT_POINTER(struct _machine_uart_obj_t *pyb_stdio_uart);

View File

@ -567,3 +567,5 @@ void timer_irq_handler(void *param) {
// }
}
}
MP_REGISTER_ROOT_POINTER(struct _pyb_timer_obj_t *pyb_timer_obj_all[MICROPY_HW_MAX_TIMER]);

View File

@ -144,4 +144,6 @@ const mp_obj_type_t pyb_switch_type = {
.locals_dict = (mp_obj_dict_t *)&pyb_switch_locals_dict,
};
MP_REGISTER_ROOT_POINTER(mp_obj_t pyb_switch_callback);
#endif // MICROPY_HW_HAS_SWITCH