auto_init/netif: add gnrc_lorawan startup routine
This commit is contained in:
parent
2edaead13e
commit
d3777d8ed8
@ -21,7 +21,11 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "board.h"
|
||||
#ifdef MODULE_GNRC_LORAWAN
|
||||
#include "net/gnrc/netif/lorawan_base.h"
|
||||
#else
|
||||
#include "net/gnrc/netif/raw.h"
|
||||
#endif
|
||||
#include "net/gnrc.h"
|
||||
|
||||
#include "sx127x.h"
|
||||
@ -56,8 +60,16 @@ void auto_init_sx127x(void)
|
||||
#endif
|
||||
|
||||
sx127x_setup(&sx127x_devs[i], &sx127x_params[i]);
|
||||
#ifdef MODULE_GNRC_LORAWAN
|
||||
/* Currently only one lora device is supported */
|
||||
assert(SX127X_NUMOF == 1);
|
||||
|
||||
gnrc_netif_lorawan_create(sx127x_stacks[i], SX127X_STACKSIZE, SX127X_PRIO,
|
||||
"sx127x", (netdev_t *)&sx127x_devs[i]);
|
||||
#else
|
||||
gnrc_netif_raw_create(sx127x_stacks[i], SX127X_STACKSIZE, SX127X_PRIO,
|
||||
"sx127x", (netdev_t *)&sx127x_devs[i]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user