From 00ac8ea69aef1f7ce00b0a890bbe880082793893 Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Wed, 30 Jan 2019 18:54:51 +0100 Subject: [PATCH] cpu/esp8266: add init function in dummy lwIP Calling the initialization function ensures that the dummy lwIP library is used instead of the real lwIP, even if the esp_wifi module for esp8266 is not used. --- cpu/esp8266/sdk/lwip.c | 7 +++++++ cpu/esp8266/startup.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/cpu/esp8266/sdk/lwip.c b/cpu/esp8266/sdk/lwip.c index 8c851ba7fc..ecf9ea08df 100644 --- a/cpu/esp8266/sdk/lwip.c +++ b/cpu/esp8266/sdk/lwip.c @@ -210,4 +210,11 @@ uint32_t espconn_init(uint32 arg) return 1; } +extern struct netif * eagle_lwip_getif(uint8_t index); + +void esp_lwip_init(void) +{ + netif_set_default((struct netif *)eagle_lwip_getif(0)); +} + #endif /* MODULE_ESP_SDK */ diff --git a/cpu/esp8266/startup.c b/cpu/esp8266/startup.c index 6a221d5562..0d50dd36c6 100644 --- a/cpu/esp8266/startup.c +++ b/cpu/esp8266/startup.c @@ -123,6 +123,10 @@ void ets_run(void) ets_isr_unmask(BIT(ETS_SOFT_INUM)); #endif + /* initialize dummy lwIP library to link it even if esp_wifi is not used */ + extern void esp_lwip_init(void); + esp_lwip_init(); + thread_create(ets_task_stack, sizeof(ets_task_stack), ETS_TASK_PRIORITY, THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,