unbreak pico[2]W auto init

This commit is contained in:
Sergio R. Caprile committed 2025-04-07 15:56:11 -03:00
1 parent 8fee24291a
commit ec0fe66a17
4 files changed
+47 -40

No files matched your search

+2 -2
View File
@@ -174,8 +174,8 @@
#define MG_SET_MAC_ADDRESS(mac)
#endif
#ifndef MG_SET_WIFI_CREDS
#define MG_SET_WIFI_CREDS(ssid, pass)
#ifndef MG_SET_WIFI_CONFIG
#define MG_SET_WIFI_CONFIG(data)
#endif
#ifndef MG_ENABLE_TCPIP_PRINT_DEBUG_STATS
+17 -15
View File
@@ -32,20 +32,22 @@ struct mg_tcpip_driver_cyw_data {
bool apmode; // start in AP mode; 'false' starts connection to 'ssid' if not NULL
};
//#define MG_TCPIP_DRIVER_INIT(mgr) \
// do { \
// static struct mg_tcpip_driver_cyw_data driver_data_; \
// static struct mg_tcpip_if mif_; \
// MG_SET_WIFI_CONFIG(&driver_data_); \
// mif_.ip = MG_TCPIP_IP; \
// mif_.mask = MG_TCPIP_MASK; \
// mif_.gw = MG_TCPIP_GW; \
// mif_.driver = &mg_tcpip_driver_pico_w; \
// mif_.driver_data = &driver_data_; \
// mif_.recv_queue.size = 8192; \
// mif_.mac[0] = 2; /* MAC read from OTP at driver init */ \
// mg_tcpip_init(mgr, &mif_); \
// MG_INFO(("Driver: cyw, MAC: %M", mg_print_mac, mif_.mac)); \
// } while (0)
#if 0
#define MG_TCPIP_DRIVER_INIT(mgr) \
do { \
static struct mg_tcpip_driver_cyw_data driver_data_; \
static struct mg_tcpip_if mif_; \
MG_SET_WIFI_CONFIG(&driver_data_); \
mif_.ip = MG_TCPIP_IP; \
mif_.mask = MG_TCPIP_MASK; \
mif_.gw = MG_TCPIP_GW; \
mif_.driver = &mg_tcpip_driver_pico_w; \
mif_.driver_data = &driver_data_; \
mif_.recv_queue.size = 8192; \
mif_.mac[0] = 2; /* MAC read from OTP at driver init */ \
mg_tcpip_init(mgr, &mif_); \
MG_INFO(("Driver: cyw, MAC: %M", mg_print_mac, mif_.mac)); \
} while (0)
#endif
#endif