Browse Source

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>
pull/8922/head
David Lechner 2 years ago
committed by Damien George
parent
commit
575fa61c6d
  1. 2
      ports/renesas-ra/extint.c
  2. 2
      ports/renesas-ra/machine_uart.c
  3. 2
      ports/renesas-ra/main.c
  4. 17
      ports/renesas-ra/mpconfigport.h
  5. 2
      ports/renesas-ra/mphalport.c
  6. 2
      ports/renesas-ra/timer.c
  7. 2
      ports/renesas-ra/usrsw.c

2
ports/renesas-ra/extint.c

@ -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]);

2
ports/renesas-ra/machine_uart.c

@ -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]);

2
ports/renesas-ra/main.c

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

17
ports/renesas-ra/mpconfigport.h

@ -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 \

2
ports/renesas-ra/mphalport.c

@ -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);

2
ports/renesas-ra/timer.c

@ -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]);

2
ports/renesas-ra/usrsw.c

@ -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

Loading…
Cancel
Save