mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-20 19:41:58 +00:00
enable CYW driver autoinit
This commit is contained in:
1 parent
11b6bd7d9c
commit
156db0bc5e
2 files changed
+28
-32
No files matched your search
+14
-16
@@ -3305,26 +3305,24 @@ struct mg_tcpip_driver_cyw_data {
|
|||||||
struct mg_wifi_data wifi;
|
struct mg_wifi_data wifi;
|
||||||
void *bus;
|
void *bus;
|
||||||
struct mg_tcpip_driver_cyw_firmware *fw;
|
struct mg_tcpip_driver_cyw_firmware *fw;
|
||||||
bool hs; // use chip "high-speed" mode; otherwise SPI CPOL0 CPHA0 (DS 4.2.3 Table 6)
|
bool hs; // use chip "high-speed" mode; otherwise SPI CPOL0 CPHA0 (DS 4.2.3 Table 6)
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
||||||
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
do { \
|
||||||
do { \
|
static struct mg_tcpip_driver_cyw_data driver_data_; \
|
||||||
static struct mg_tcpip_driver_cyw_data driver_data_; \
|
static struct mg_tcpip_if mif_; \
|
||||||
static struct mg_tcpip_if mif_; \
|
MG_SET_WIFI_CONFIG(&driver_data_); \
|
||||||
MG_SET_WIFI_CONFIG(&driver_data_); \
|
mif_.ip = MG_TCPIP_IP; \
|
||||||
mif_.ip = MG_TCPIP_IP; \
|
mif_.mask = MG_TCPIP_MASK; \
|
||||||
mif_.mask = MG_TCPIP_MASK; \
|
mif_.gw = MG_TCPIP_GW; \
|
||||||
mif_.gw = MG_TCPIP_GW; \
|
mif_.driver = &mg_tcpip_driver_cyw; \
|
||||||
mif_.driver = &mg_tcpip_driver_pico_w; \
|
mif_.driver_data = &driver_data_; \
|
||||||
mif_.driver_data = &driver_data_; \
|
mif_.recv_queue.size = 8192; \
|
||||||
mif_.recv_queue.size = 8192; \
|
mif_.mac[0] = 2; /* MAC read from OTP at driver init */ \
|
||||||
mif_.mac[0] = 2; /* MAC read from OTP at driver init */ \
|
mg_tcpip_init(mgr, &mif_); \
|
||||||
mg_tcpip_init(mgr, &mif_); \
|
|
||||||
MG_INFO(("Driver: cyw, MAC: %M", mg_print_mac, mif_.mac)); \
|
MG_INFO(("Driver: cyw, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+14
-16
@@ -25,25 +25,23 @@ struct mg_tcpip_driver_cyw_data {
|
|||||||
struct mg_wifi_data wifi;
|
struct mg_wifi_data wifi;
|
||||||
void *bus;
|
void *bus;
|
||||||
struct mg_tcpip_driver_cyw_firmware *fw;
|
struct mg_tcpip_driver_cyw_firmware *fw;
|
||||||
bool hs; // use chip "high-speed" mode; otherwise SPI CPOL0 CPHA0 (DS 4.2.3 Table 6)
|
bool hs; // use chip "high-speed" mode; otherwise SPI CPOL0 CPHA0 (DS 4.2.3 Table 6)
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
||||||
#define MG_TCPIP_DRIVER_INIT(mgr) \
|
do { \
|
||||||
do { \
|
static struct mg_tcpip_driver_cyw_data driver_data_; \
|
||||||
static struct mg_tcpip_driver_cyw_data driver_data_; \
|
static struct mg_tcpip_if mif_; \
|
||||||
static struct mg_tcpip_if mif_; \
|
MG_SET_WIFI_CONFIG(&driver_data_); \
|
||||||
MG_SET_WIFI_CONFIG(&driver_data_); \
|
mif_.ip = MG_TCPIP_IP; \
|
||||||
mif_.ip = MG_TCPIP_IP; \
|
mif_.mask = MG_TCPIP_MASK; \
|
||||||
mif_.mask = MG_TCPIP_MASK; \
|
mif_.gw = MG_TCPIP_GW; \
|
||||||
mif_.gw = MG_TCPIP_GW; \
|
mif_.driver = &mg_tcpip_driver_cyw; \
|
||||||
mif_.driver = &mg_tcpip_driver_pico_w; \
|
mif_.driver_data = &driver_data_; \
|
||||||
mif_.driver_data = &driver_data_; \
|
mif_.recv_queue.size = 8192; \
|
||||||
mif_.recv_queue.size = 8192; \
|
mif_.mac[0] = 2; /* MAC read from OTP at driver init */ \
|
||||||
mif_.mac[0] = 2; /* MAC read from OTP at driver init */ \
|
mg_tcpip_init(mgr, &mif_); \
|
||||||
mg_tcpip_init(mgr, &mif_); \
|
|
||||||
MG_INFO(("Driver: cyw, MAC: %M", mg_print_mac, mif_.mac)); \
|
MG_INFO(("Driver: cyw, MAC: %M", mg_print_mac, mif_.mac)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user