-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/lwip: Move at86rf2xx to netif auto init
- Loading branch information
Showing
3 changed files
with
50 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright (C) Freie Universität Berlin | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup sys_auto_init_lwip_netif | ||
* @{ | ||
* | ||
* @file | ||
* @brief Auto initialization for at86rf2xx network interfaces | ||
* | ||
* @author Martine Lenders <mlenders@inf.fu-berlin.de> | ||
* @author Erik Ekman <eekman@google.com> | ||
*/ | ||
|
||
#include "at86rf2xx.h" | ||
#include "at86rf2xx_params.h" | ||
|
||
#include "lwip_init_devs.h" | ||
|
||
#define ENABLE_DEBUG 0 | ||
#include "debug.h" | ||
|
||
#define NETIF_AT86RF2XX_NUMOF ARRAY_SIZE(at86rf2xx_params) | ||
|
||
static struct netif netif[NETIF_AT86RF2XX_NUMOF]; | ||
static at86rf2xx_t at86rf2xx_devs[NETIF_AT86RF2XX_NUMOF]; | ||
|
||
void auto_init_at86rf2xx(void) | ||
{ | ||
for (unsigned i = 0; i < NETIF_AT86RF2XX_NUMOF; i++) { | ||
at86rf2xx_setup(&at86rf2xx_devs[i], &at86rf2xx_params[i], i); | ||
if (lwip_add_6lowpan(&netif[i], &at86rf2xx_devs[i].netdev.netdev) == NULL) { | ||
DEBUG("Could not add at86rf2xx device\n"); | ||
return; | ||
} | ||
} | ||
} | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters