Skip to content

Commit

Permalink
cpu/esp8266: add init function in dummy lwIP
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gschorcht committed Feb 2, 2019
1 parent 3406cff commit 7f62977
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cpu/esp8266/sdk/lwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
4 changes: 4 additions & 0 deletions cpu/esp8266/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7f62977

Please sign in to comment.