rp2: Use MP_REGISTER_ROOT_POINTER().

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

Signed-off-by: David Lechner <david@pybricks.com>
pull/8922/head
David Lechner 2022-07-01 14:47:42 -05:00 zatwierdzone przez Damien George
rodzic 575fa61c6d
commit ffa22b8f97
6 zmienionych plików z 12 dodań i 13 usunięć

Wyświetl plik

@ -1147,3 +1147,5 @@ const mp_obj_type_t machine_i2s_type = {
.make_new = machine_i2s_make_new,
.locals_dict = (mp_obj_dict_t *)&machine_i2s_locals_dict,
};
MP_REGISTER_ROOT_POINTER(void *machine_i2s_obj[2]);

Wyświetl plik

@ -687,3 +687,5 @@ mp_hal_pin_obj_t mp_hal_get_pin_obj(mp_obj_t obj) {
}
return pin->id;
}
MP_REGISTER_ROOT_POINTER(void *machine_pin_irq_obj[30]);

Wyświetl plik

@ -562,3 +562,6 @@ 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(void *rp2_uart_rx_buffer[2]);
MP_REGISTER_ROOT_POINTER(void *rp2_uart_tx_buffer[2]);

Wyświetl plik

@ -197,4 +197,6 @@ MP_WEAK int mp_bluetooth_hci_controller_wakeup(void) {
return 0;
}
MP_REGISTER_ROOT_POINTER(struct _machine_uart_obj_t *mp_bthci_uart);
#endif // MICROPY_PY_BLUETOOTH

Wyświetl plik

@ -135,12 +135,6 @@
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args)
#endif
#if MICROPY_PY_BLUETOOTH
#define MICROPY_PORT_ROOT_POINTER_BLUETOOTH struct _machine_uart_obj_t *mp_bthci_uart;
#else
#define MICROPY_PORT_ROOT_POINTER_BLUETOOTH
#endif
// By default networking should include sockets, ssl, websockets, webrepl, dupterm.
#if MICROPY_PY_NETWORK
#ifndef MICROPY_PY_USOCKET
@ -215,14 +209,7 @@ extern const struct _mod_network_nic_type_t mod_network_nic_type_wiznet5k;
#endif
#define MICROPY_PORT_ROOT_POINTERS \
void *machine_pin_irq_obj[30]; \
void *rp2_pio_irq_obj[2]; \
void *rp2_state_machine_irq_obj[8]; \
void *rp2_uart_rx_buffer[2]; \
void *rp2_uart_tx_buffer[2]; \
void *machine_i2s_obj[2]; \
MICROPY_BOARD_ROOT_POINTERS \
MICROPY_PORT_ROOT_POINTER_BLUETOOTH \
#define MP_STATE_PORT MP_STATE_VM

Wyświetl plik

@ -839,3 +839,6 @@ STATIC const mp_irq_methods_t rp2_state_machine_irq_methods = {
.trigger = rp2_state_machine_irq_trigger,
.info = rp2_state_machine_irq_info,
};
MP_REGISTER_ROOT_POINTER(void *rp2_pio_irq_obj[2]);
MP_REGISTER_ROOT_POINTER(void *rp2_state_machine_irq_obj[8]);