mirror of
https://github.com/micropython/micropython.git
synced 2025-12-15 17:30:14 +01:00
extmod/modnetwork: Consolidate definition of common drivers.
Most extmod network drivers were being defined on a per-port basis, duplicating code and making enabling a driver on a new port harder. This consolidates extmod driver declarations and removes the existing per-port definitions of them. This commit has been verified to be a no-op in terms of firmware change. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This commit is contained in:
committed by
Damien George
parent
95203ab88b
commit
fffaf8a41f
@@ -242,46 +242,11 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_NETWORK_CYW43
|
||||
extern const struct _mp_obj_type_t mp_network_cyw43_type;
|
||||
#define MICROPY_HW_NIC_CYW43 \
|
||||
{ MP_ROM_QSTR(MP_QSTR_WLAN), MP_ROM_PTR(&mp_network_cyw43_type) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_STAT_IDLE), MP_ROM_INT(CYW43_LINK_DOWN) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_STAT_CONNECTING), MP_ROM_INT(CYW43_LINK_JOIN) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_STAT_WRONG_PASSWORD), MP_ROM_INT(CYW43_LINK_BADAUTH) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_STAT_NO_AP_FOUND), MP_ROM_INT(CYW43_LINK_NONET) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_STAT_CONNECT_FAIL), MP_ROM_INT(CYW43_LINK_FAIL) }, \
|
||||
{ MP_ROM_QSTR(MP_QSTR_STAT_GOT_IP), MP_ROM_INT(CYW43_LINK_UP) },
|
||||
#else
|
||||
#define MICROPY_HW_NIC_CYW43
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_NETWORK_NINAW10
|
||||
// This Network interface requires the extended socket state.
|
||||
#ifndef MICROPY_PY_SOCKET_EXTENDED_STATE
|
||||
#define MICROPY_PY_SOCKET_EXTENDED_STATE (1)
|
||||
#endif
|
||||
extern const struct _mp_obj_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
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_NETWORK_WIZNET5K
|
||||
extern const struct _mp_obj_type_t mod_network_nic_type_wiznet5k;
|
||||
#define MICROPY_HW_NIC_WIZNET5K { MP_ROM_QSTR(MP_QSTR_WIZNET5K), MP_ROM_PTR(&mod_network_nic_type_wiznet5k) },
|
||||
#else
|
||||
#define MICROPY_HW_NIC_WIZNET5K
|
||||
#endif
|
||||
|
||||
#ifndef MICROPY_BOARD_NETWORK_INTERFACES
|
||||
#define MICROPY_BOARD_NETWORK_INTERFACES
|
||||
#endif
|
||||
|
||||
#define MICROPY_PORT_NETWORK_INTERFACES \
|
||||
MICROPY_HW_NIC_CYW43 \
|
||||
MICROPY_HW_NIC_NINAW10 \
|
||||
MICROPY_HW_NIC_WIZNET5K \
|
||||
MICROPY_BOARD_NETWORK_INTERFACES \
|
||||
|
||||
// Additional entries for use with pendsv_schedule_dispatch.
|
||||
|
||||
Reference in New Issue
Block a user