diff options
| author | David Lechner <david@pybricks.com> | 2022-07-01 15:37:12 -0500 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-07-18 13:49:28 +1000 |
| commit | ac86e8449afebdef38b02af7acfc0ed535db9d94 (patch) | |
| tree | 76d7674163a8380c623ab8bfb49b8c6ebd0a60d7 | |
| parent | e5631d959517fcdd8752c60a1c5d07e8e86fbfa5 (diff) | |
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>
| -rw-r--r-- | drivers/ninaw10/nina_wifi_bsp.c | 4 | ||||
| -rw-r--r-- | ports/rp2/mpconfigport.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ninaw10/nina_wifi_bsp.c b/drivers/ninaw10/nina_wifi_bsp.c index a65ef7fd8..d11e13970 100644 --- a/drivers/ninaw10/nina_wifi_bsp.c +++ b/drivers/ninaw10/nina_wifi_bsp.c @@ -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 diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h index 1e8510484..87bddbeb7 100644 --- a/ports/rp2/mpconfigport.h +++ b/ports/rp2/mpconfigport.h @@ -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 \ |
