File tree Expand file tree Collapse file tree 2 files changed +32
-7
lines changed Expand file tree Collapse file tree 2 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 1010#include " esp_mac.h"
1111#include " netdb.h"
1212
13- #if CONFIG_ESP_WIFI_REMOTE_ENABLED
14- extern " C" esp_err_t esp_hosted_init (void *);
15- #endif
16-
1713NetworkManager::NetworkManager () {}
1814
1915NetworkInterface *getNetifByID (Network_Interface_ID id);
@@ -22,9 +18,6 @@ bool NetworkManager::begin() {
2218 static bool initialized = false ;
2319 if (!initialized) {
2420 initialized = true ;
25- #if CONFIG_ESP_WIFI_REMOTE_ENABLED
26- esp_hosted_init (NULL );
27- #endif
2821#if CONFIG_IDF_TARGET_ESP32
2922 uint8_t mac[8 ];
3023 if (esp_efuse_mac_get_default (mac) == ESP_OK) {
Original file line number Diff line number Diff line change @@ -233,9 +233,41 @@ void WiFiGenericClass::useStaticBuffers(bool bufferMode) {
233233extern " C" void phy_bbpll_en_usb (bool en);
234234#endif
235235
236+ #if CONFIG_ESP_WIFI_REMOTE_ENABLED
237+ extern " C" esp_err_t esp_hosted_init (void *);
238+
239+ static bool wifiHostedInit () {
240+ static bool initialized = false ;
241+ if (!initialized) {
242+ initialized = true ;
243+ if (esp_hosted_init (NULL ) != ESP_OK) {
244+ log_e (" esp_hosted_init failed!" );
245+ return false ;
246+ }
247+ }
248+ // Attach pins to periman here
249+ // Slave chip model is CONFIG_IDF_SLAVE_TARGET
250+ // CONFIG_ESP_SDIO_PIN_CMD
251+ // CONFIG_ESP_SDIO_PIN_CLK
252+ // CONFIG_ESP_SDIO_PIN_D0
253+ // CONFIG_ESP_SDIO_PIN_D1
254+ // CONFIG_ESP_SDIO_PIN_D2
255+ // CONFIG_ESP_SDIO_PIN_D3
256+ // CONFIG_ESP_SDIO_GPIO_RESET_SLAVE
257+
258+ return true ;
259+ }
260+ #endif
261+
236262bool wifiLowLevelInit (bool persistent) {
237263 if (!lowLevelInitDone) {
238264 lowLevelInitDone = true ;
265+ #if CONFIG_ESP_WIFI_REMOTE_ENABLED
266+ if (!wifiHostedInit ()) {
267+ lowLevelInitDone = false ;
268+ return lowLevelInitDone;
269+ }
270+ #endif
239271 if (!Network.begin ()) {
240272 lowLevelInitDone = false ;
241273 return lowLevelInitDone;
You can’t perform that action at this time.
0 commit comments