Skip to content

Commit

Permalink
Merge pull request RIOT-OS#12895 from wosym/lwip_stm32
Browse files Browse the repository at this point in the history
pkg/lwip: add STM32 support
  • Loading branch information
benpicco authored Dec 6, 2019
2 parents 29a3a7f + ed9cdb2 commit 43290f6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/lwip/contrib/lwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#include "esp-wifi/esp_wifi_netdev.h"
#endif

#ifdef MODULE_STM32_ETH
#include "stm32_eth.h"
#endif

#include "lwip.h"

#define ENABLE_DEBUG (0)
Expand All @@ -67,6 +71,10 @@
#define LWIP_NETIF_NUMOF (1)
#endif

#ifdef MODULE_STM32_ETH
#define LWIP_NETIF_NUMOF (1)
#endif

#ifdef LWIP_NETIF_NUMOF
static struct netif netif[LWIP_NETIF_NUMOF];
#endif
Expand All @@ -92,6 +100,11 @@ extern esp_wifi_netdev_t _esp_wifi_dev;
extern void esp_wifi_setup (esp_wifi_netdev_t* dev);
#endif

#ifdef MODULE_STM32_ETH
static netdev_t stm32_eth;
extern void stm32_eth_netdev_setup(netdev_t *netdev);
#endif

void lwip_bootstrap(void)
{
/* TODO: do for every eligible netdev */
Expand Down Expand Up @@ -139,6 +152,13 @@ void lwip_bootstrap(void)
DEBUG("Could not add esp_wifi device\n");
return;
}
#elif defined(MODULE_STM32_ETH)
stm32_eth_netdev_setup(&stm32_eth);
if (netif_add(&netif[0], &stm32_eth, lwip_netdev_init,
tcpip_input) == NULL) {
DEBUG("Could not add stm32_eth device\n");
return;
}
#endif
if (netif[0].state != NULL) {
/* state is set to a netdev_t in the netif_add() functions above */
Expand Down

0 comments on commit 43290f6

Please sign in to comment.