File tree 2 files changed +32
-7
lines changed
2 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 10
10
#include " esp_mac.h"
11
11
#include " netdb.h"
12
12
13
- #if CONFIG_ESP_WIFI_REMOTE_ENABLED
14
- extern " C" esp_err_t esp_hosted_init (void *);
15
- #endif
16
-
17
13
NetworkManager::NetworkManager () {}
18
14
19
15
NetworkInterface *getNetifByID (Network_Interface_ID id);
@@ -22,9 +18,6 @@ bool NetworkManager::begin() {
22
18
static bool initialized = false ;
23
19
if (!initialized) {
24
20
initialized = true ;
25
- #if CONFIG_ESP_WIFI_REMOTE_ENABLED
26
- esp_hosted_init (NULL );
27
- #endif
28
21
#if CONFIG_IDF_TARGET_ESP32
29
22
uint8_t mac[8 ];
30
23
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) {
233
233
extern " C" void phy_bbpll_en_usb (bool en);
234
234
#endif
235
235
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
+
236
262
bool wifiLowLevelInit (bool persistent) {
237
263
if (!lowLevelInitDone) {
238
264
lowLevelInitDone = true ;
265
+ #if CONFIG_ESP_WIFI_REMOTE_ENABLED
266
+ if (!wifiHostedInit ()) {
267
+ lowLevelInitDone = false ;
268
+ return lowLevelInitDone;
269
+ }
270
+ #endif
239
271
if (!Network.begin ()) {
240
272
lowLevelInitDone = false ;
241
273
return lowLevelInitDone;
You can’t perform that action at this time.
0 commit comments