drivers/ninaw10/nina_wifi_bsp: Use MP_REGISTER_ROOT_POINTER().

This uses MP_REGISTER_ROOT_POINTER() to register mp_wifi_spi, mp_wifi_timer
and mp_wifi_sockpoll_list and removes the same from all mpconfigport.h.

Signed-off-by: David Lechner <david@pybricks.com>
This commit is contained in:
David Lechner 2022-07-01 15:37:12 -05:00 committed by Damien George
parent e5631d9595
commit ac86e8449a
2 changed files with 4 additions and 3 deletions

View File

@ -150,4 +150,8 @@ int nina_bsp_spi_transfer(const uint8_t *tx_buf, uint8_t *rx_buf, uint32_t size)
return 0;
}
MP_REGISTER_ROOT_POINTER(struct _machine_spi_obj_t *mp_wifi_spi);
MP_REGISTER_ROOT_POINTER(struct _machine_timer_obj_t *mp_wifi_timer);
MP_REGISTER_ROOT_POINTER(struct _mp_obj_list_t *mp_wifi_sockpoll_list);
#endif // MICROPY_PY_NETWORK_NINAW10

View File

@ -197,12 +197,10 @@ extern const struct _mp_obj_type_t mp_network_cyw43_type;
#define MICROPY_PY_USOCKET_EXTENDED_STATE (1)
#endif
// It also requires an additional root pointer for the SPI object.
#define MICROPY_PORT_ROOT_POINTER_NINAW10 struct _machine_spi_obj_t *mp_wifi_spi; struct _machine_timer_obj_t *mp_wifi_timer; struct _mp_obj_list_t *mp_wifi_sockpoll_list;
extern const struct _mod_network_nic_type_t mod_network_nic_type_nina;
#define MICROPY_HW_NIC_NINAW10 { MP_ROM_QSTR(MP_QSTR_WLAN), MP_ROM_PTR(&mod_network_nic_type_nina) },
#else
#define MICROPY_HW_NIC_NINAW10
#define MICROPY_PORT_ROOT_POINTER_NINAW10
#endif
#if MICROPY_PY_NETWORK_WIZNET5K
@ -239,7 +237,6 @@ extern const struct _mod_network_nic_type_t mod_network_nic_type_wiznet5k;
void *machine_i2s_obj[2]; \
NETWORK_ROOT_POINTERS \
MICROPY_BOARD_ROOT_POINTERS \
MICROPY_PORT_ROOT_POINTER_NINAW10 \
MICROPY_PORT_ROOT_POINTER_BLUETOOTH \
MICROPY_PORT_ROOT_POINTER_BLUETOOTH_NIMBLE \