mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 22:13:52 +01:00
Merge pull request #13092 from Ciusss89/lwip_enc28j60
pkg/lwip: add auto-init support for transciever ENC28J60
This commit is contained in:
commit
f144a12c71
@ -28,6 +28,11 @@
|
||||
#include "at86rf2xx_params.h"
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_ENC28J60
|
||||
#include "enc28j60.h"
|
||||
#include "enc28j60_params.h"
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_MRF24J40
|
||||
#include "mrf24j40.h"
|
||||
#include "mrf24j40_params.h"
|
||||
@ -63,6 +68,10 @@
|
||||
#define LWIP_NETIF_NUMOF ARRAY_SIZE(at86rf2xx_params)
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_ENC28J60 /* is mutual exclusive with above ifdef */
|
||||
#define LWIP_NETIF_NUMOF ARRAY_SIZE(enc28j60_params)
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_MRF24J40 /* is mutual exclusive with above ifdef */
|
||||
#define LWIP_NETIF_NUMOF ARRAY_SIZE(mrf24j40_params)
|
||||
#endif
|
||||
@ -95,6 +104,10 @@ static netdev_tap_t netdev_taps[LWIP_NETIF_NUMOF];
|
||||
static at86rf2xx_t at86rf2xx_devs[LWIP_NETIF_NUMOF];
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_ENC28J60
|
||||
static enc28j60_t enc28j60_devs[LWIP_NETIF_NUMOF];
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_MRF24J40
|
||||
static mrf24j40_t mrf24j40_devs[LWIP_NETIF_NUMOF];
|
||||
#endif
|
||||
@ -149,6 +162,23 @@ void lwip_bootstrap(void)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#elif defined(MODULE_ENC28J60)
|
||||
for (unsigned i = 0; i < LWIP_NETIF_NUMOF; i++) {
|
||||
enc28j60_setup(&enc28j60_devs[i], &enc28j60_params[i]);
|
||||
#ifdef MODULE_LWIP_IPV4
|
||||
if (netif_add(&netif[0], IP4_ADDR_ANY, IP4_ADDR_ANY, IP4_ADDR_ANY,
|
||||
&enc28j60_devs[i], lwip_netdev_init, tcpip_input) == NULL) {
|
||||
DEBUG("Could not add enc28j60 device\n");
|
||||
return;
|
||||
}
|
||||
#else /* MODULE_LWIP_IPV4 */
|
||||
if (netif_add(&netif[0], &enc28j60_devs[i], lwip_netdev_init,
|
||||
tcpip_input) == NULL) {
|
||||
DEBUG("Could not add enc28j60 device\n");
|
||||
return;
|
||||
}
|
||||
#endif /* MODULE_LWIP_IPV4 */
|
||||
}
|
||||
#elif defined(MODULE_SOCKET_ZEP)
|
||||
for (unsigned i = 0; i < LWIP_NETIF_NUMOF; i++) {
|
||||
socket_zep_setup(&socket_zep_devs[i], &socket_zep_params[i]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user