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>
This commit is contained in:
parent
575fa61c6d
commit
ffa22b8f97
@ -1147,3 +1147,5 @@ const mp_obj_type_t machine_i2s_type = {
|
|||||||
.make_new = machine_i2s_make_new,
|
.make_new = machine_i2s_make_new,
|
||||||
.locals_dict = (mp_obj_dict_t *)&machine_i2s_locals_dict,
|
.locals_dict = (mp_obj_dict_t *)&machine_i2s_locals_dict,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MP_REGISTER_ROOT_POINTER(void *machine_i2s_obj[2]);
|
||||||
|
@ -687,3 +687,5 @@ mp_hal_pin_obj_t mp_hal_get_pin_obj(mp_obj_t obj) {
|
|||||||
}
|
}
|
||||||
return pin->id;
|
return pin->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MP_REGISTER_ROOT_POINTER(void *machine_pin_irq_obj[30]);
|
||||||
|
@ -562,3 +562,6 @@ const mp_obj_type_t machine_uart_type = {
|
|||||||
.protocol = &uart_stream_p,
|
.protocol = &uart_stream_p,
|
||||||
.locals_dict = (mp_obj_dict_t *)&machine_uart_locals_dict,
|
.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]);
|
||||||
|
@ -197,4 +197,6 @@ MP_WEAK int mp_bluetooth_hci_controller_wakeup(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MP_REGISTER_ROOT_POINTER(struct _machine_uart_obj_t *mp_bthci_uart);
|
||||||
|
|
||||||
#endif // MICROPY_PY_BLUETOOTH
|
#endif // MICROPY_PY_BLUETOOTH
|
||||||
|
@ -135,12 +135,6 @@
|
|||||||
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args)
|
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args)
|
||||||
#endif
|
#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.
|
// By default networking should include sockets, ssl, websockets, webrepl, dupterm.
|
||||||
#if MICROPY_PY_NETWORK
|
#if MICROPY_PY_NETWORK
|
||||||
#ifndef MICROPY_PY_USOCKET
|
#ifndef MICROPY_PY_USOCKET
|
||||||
@ -215,14 +209,7 @@ extern const struct _mod_network_nic_type_t mod_network_nic_type_wiznet5k;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MICROPY_PORT_ROOT_POINTERS \
|
#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_BOARD_ROOT_POINTERS \
|
||||||
MICROPY_PORT_ROOT_POINTER_BLUETOOTH \
|
|
||||||
|
|
||||||
#define MP_STATE_PORT MP_STATE_VM
|
#define MP_STATE_PORT MP_STATE_VM
|
||||||
|
|
||||||
|
@ -839,3 +839,6 @@ STATIC const mp_irq_methods_t rp2_state_machine_irq_methods = {
|
|||||||
.trigger = rp2_state_machine_irq_trigger,
|
.trigger = rp2_state_machine_irq_trigger,
|
||||||
.info = rp2_state_machine_irq_info,
|
.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]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user