From a491dd02a130f02d4226fc9514055a847a602d21 Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Sun, 8 Jan 2017 15:06:40 +0100 Subject: [PATCH] Uncrustify and static check --- drivers/include/mrf24j40.h | 16 ++--- drivers/mrf24j40/Makefile | 2 +- drivers/mrf24j40/include/mrf24j40_internal.h | 8 +++ drivers/mrf24j40/include/mrf24j40_registers.h | 17 +++-- drivers/mrf24j40/mrf24j40.c | 9 ++- drivers/mrf24j40/mrf24j40_getset.c | 69 ++++++++++--------- drivers/mrf24j40/mrf24j40_internal.c | 47 ++++++++----- drivers/mrf24j40/mrf24j40_netdev.c | 50 +++++++------- sys/auto_init/netif/auto_init_mrf24j40.c | 2 +- 9 files changed, 118 insertions(+), 102 deletions(-) diff --git a/drivers/include/mrf24j40.h b/drivers/include/mrf24j40.h index 54f6cbc48b6fb..7c272f1ace163 100644 --- a/drivers/include/mrf24j40.h +++ b/drivers/include/mrf24j40.h @@ -148,11 +148,11 @@ extern "C" { /** @} */ -#define MRF24J40_TASK_TX_DONE (0x01) -#define MRF24J40_TASK_TX_READY (0x02) -#define MRF24J40_TASK_RX_READY (0x04) +#define MRF24J40_TASK_TX_DONE (0x01) /**< TX operation is done */ +#define MRF24J40_TASK_TX_READY (0x02) /**< TX operation results ready for processing */ +#define MRF24J40_TASK_RX_READY (0x04) /**< RX processing needed */ -#define MRF24J40_MAX_FRAME_RETRIES (3U) +#define MRF24J40_MAX_FRAME_RETRIES (3U) /**< Number of frame retries (fixed) */ /** * @brief struct holding all params needed for device initialization @@ -447,14 +447,6 @@ size_t mrf24j40_tx_load(mrf24j40_t *dev, uint8_t *data, size_t len, */ void mrf24j40_tx_exec(mrf24j40_t *dev); -/** - * @brief Initialize the MRF24J40 Interrupt / Port and Pin of uC - * - * @param dev device to read from - */ -void init_mrf24j40_int(void); - - #ifdef __cplusplus } #endif diff --git a/drivers/mrf24j40/Makefile b/drivers/mrf24j40/Makefile index 1ead3177295bf..48422e909a47d 100644 --- a/drivers/mrf24j40/Makefile +++ b/drivers/mrf24j40/Makefile @@ -1 +1 @@ -include $(RIOTBASE)/Makefile.base +include $(RIOTBASE)/Makefile.base diff --git a/drivers/mrf24j40/include/mrf24j40_internal.h b/drivers/mrf24j40/include/mrf24j40_internal.h index 2d56cddedf874..b00356fffe6a5 100644 --- a/drivers/mrf24j40/include/mrf24j40_internal.h +++ b/drivers/mrf24j40/include/mrf24j40_internal.h @@ -1,3 +1,11 @@ +/* + * Copyright (C) 2017 Koen Zandberg + * + * 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 drivers_mrf24j40 * @{ diff --git a/drivers/mrf24j40/include/mrf24j40_registers.h b/drivers/mrf24j40/include/mrf24j40_registers.h index 6d2664d1e8880..7e9110555c6a4 100644 --- a/drivers/mrf24j40/include/mrf24j40_registers.h +++ b/drivers/mrf24j40/include/mrf24j40_registers.h @@ -1,3 +1,11 @@ +/* + * Copyright (C) 2017 Koen Zandberg + * + * 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 drivers_mrf24j40 * @{ @@ -18,7 +26,7 @@ extern "C" { /** * @brief SPI access specifiers - ****@{ + *****@{ */ #define MRF24J40_SHORT_ADDR_TRANS (0x00) #define MRF24J40_LONG_ADDR_TRANS (0x80) @@ -30,7 +38,7 @@ extern "C" { /** * @brief FIFO-Address-Map - ***@{ + ****@{ */ #define MRF24J40_TX_NORMAL_FIFO (0x000) #define MRF24J40_TX_BEACON_FIFO (0x080) @@ -41,7 +49,7 @@ extern "C" { /** * @brief Short-Register addresses - ****@{ + *****@{ */ #define MRF24J40_REG_RXMCR (0x00) #define MRF24J40_REG_PANIDL (0x01) @@ -105,7 +113,7 @@ extern "C" { /** * @brief Long-Register addresses - ****@{ + *****@{ */ #define MRF24J40_REG_RFCON0 (0x200) #define MRF24J40_REG_RFCON1 (0x201) @@ -436,4 +444,3 @@ extern "C" { #endif /* MRF24J40_REGISTERS_H */ /** @} */ - diff --git a/drivers/mrf24j40/mrf24j40.c b/drivers/mrf24j40/mrf24j40.c index 9142ab86a6c2c..c2d4566d2e6cf 100644 --- a/drivers/mrf24j40/mrf24j40.c +++ b/drivers/mrf24j40/mrf24j40.c @@ -152,7 +152,7 @@ void mrf24j40_tx_prepare(mrf24j40_t *dev) do { mrf24j40_update_tasks(dev); - } while(!(dev->pending & MRF24J40_TASK_TX_DONE)); + } while (!(dev->pending & MRF24J40_TASK_TX_DONE)); mrf24j40_assert_awake(dev); dev->pending &= ~(MRF24J40_TASK_TX_DONE); dev->tx_frame_len = IEEE802154_FCS_LEN; @@ -185,11 +185,10 @@ void mrf24j40_tx_exec(mrf24j40_t *dev) mrf24j40_reg_write_long(dev, MRF24J40_TX_NORMAL_FIFO, dev->header_len); if (dev->netdev.flags & NETDEV2_IEEE802154_ACK_REQ) { - mrf24j40_reg_write_short(dev, MRF24J40_REG_TXNCON, MRF24J40_TXNCON_TXNACKREQ|MRF24J40_TXNCON_TXNTRIG); + mrf24j40_reg_write_short(dev, MRF24J40_REG_TXNCON, MRF24J40_TXNCON_TXNACKREQ | MRF24J40_TXNCON_TXNTRIG); } - else - { - mrf24j40_reg_write_short(dev, MRF24J40_REG_TXNCON, MRF24J40_TXNCON_TXNTRIG); + else { + mrf24j40_reg_write_short(dev, MRF24J40_REG_TXNCON, MRF24J40_TXNCON_TXNTRIG); } if (netdev->event_callback && (dev->netdev.flags & MRF24J40_OPT_TELL_TX_START)) { netdev->event_callback(netdev, NETDEV2_EVENT_TX_STARTED); diff --git a/drivers/mrf24j40/mrf24j40_getset.c b/drivers/mrf24j40/mrf24j40_getset.c index 9d4d336ebe5df..55210dccd1bb1 100644 --- a/drivers/mrf24j40/mrf24j40_getset.c +++ b/drivers/mrf24j40/mrf24j40_getset.c @@ -73,37 +73,37 @@ static const uint8_t dbm_to_tx_pow[] = { 0x00, 0x10, 0x18, 0x20, 0x28, 0x30, 0x3 /* take a look onto datasheet table 3-8 */ static const int8_t dBm_value[] = { 95, 89, 88, 88, 87, 87, 87, 87, \ - 86, 86, 86, 86, 85, 85, 85, 85, \ - 84, 84, 84, 84, 84, 84, 83, 83, \ - 83, 83, 82, 82, 82, 82, 81, 81, \ - 81, 81, 81, 80, 80, 80, 80, 80, \ - 80, 79, 79, 79, 79, 79, 78, 78, \ - 78, 78, 78, 77, 77, 77, 77, 77, \ - 76, 76, 76, 76, 76, 75, 75, 75, \ - 75, 75, 75, 74, 74, 74, 74, 73, \ - 73, 73, 73, 73, 72, 72, 72, 72, \ - 72, 71, 71, 71, 71, 71, 70, 70, \ - 70, 70, 70, 70, 70, 69, 69, 69, \ - 69, 69, 68, 68, 68, 68, 68, 68, \ - 68, 67, 67, 67, 67, 66, 66, 66, \ - 66, 66, 66, 65, 65, 65, 65, 65, \ - 64, 64, 64, 64, 63, 63, 63, 63, \ - 62, 62, 62, 62, 61, 61, 61, 61, \ - 60, 60, 60, 60, 60, 59, 59, 59, \ - 59, 59, 58, 58, 58, 58, 58, 57, \ - 57, 57, 57, 57, 57, 56, 56, 56, \ - 56, 56, 56, 56, 55, 55, 55, 55, \ - 54, 54, 54, 54, 54, 54, 53, 53, \ - 53, 53, 53, 53, 53, 52, 52, 52, \ - 52, 52, 52, 51, 51, 51, 51, 51, \ - 50, 50, 50, 50, 50, 49, 49, 49, \ - 49, 49, 48, 48, 48, 48, 47, 47, \ - 47, 47, 47, 46, 46, 46, 46, 45, \ - 45, 45, 45, 44, 44, 44, 44, 44, \ - 43, 43, 43, 42, 42, 42, 42, 41, \ - 41, 41, 41, 41, 41, 40, 40, 40, \ - 40, 40, 39, 39, 39, 39, 39, 38, \ - 38, 38, 38, 37, 37, 37, 36, 30 }; + 86, 86, 86, 86, 85, 85, 85, 85, \ + 84, 84, 84, 84, 84, 84, 83, 83, \ + 83, 83, 82, 82, 82, 82, 81, 81, \ + 81, 81, 81, 80, 80, 80, 80, 80, \ + 80, 79, 79, 79, 79, 79, 78, 78, \ + 78, 78, 78, 77, 77, 77, 77, 77, \ + 76, 76, 76, 76, 76, 75, 75, 75, \ + 75, 75, 75, 74, 74, 74, 74, 73, \ + 73, 73, 73, 73, 72, 72, 72, 72, \ + 72, 71, 71, 71, 71, 71, 70, 70, \ + 70, 70, 70, 70, 70, 69, 69, 69, \ + 69, 69, 68, 68, 68, 68, 68, 68, \ + 68, 67, 67, 67, 67, 66, 66, 66, \ + 66, 66, 66, 65, 65, 65, 65, 65, \ + 64, 64, 64, 64, 63, 63, 63, 63, \ + 62, 62, 62, 62, 61, 61, 61, 61, \ + 60, 60, 60, 60, 60, 59, 59, 59, \ + 59, 59, 58, 58, 58, 58, 58, 57, \ + 57, 57, 57, 57, 57, 56, 56, 56, \ + 56, 56, 56, 56, 55, 55, 55, 55, \ + 54, 54, 54, 54, 54, 54, 53, 53, \ + 53, 53, 53, 53, 53, 52, 52, 52, \ + 52, 52, 52, 51, 51, 51, 51, 51, \ + 50, 50, 50, 50, 50, 49, 49, 49, \ + 49, 49, 48, 48, 48, 48, 47, 47, \ + 47, 47, 47, 46, 46, 46, 46, 45, \ + 45, 45, 45, 44, 44, 44, 44, 44, \ + 43, 43, 43, 42, 42, 42, 42, 41, \ + 41, 41, 41, 41, 41, 40, 40, 40, \ + 40, 40, 39, 39, 39, 39, 39, 38, \ + 38, 38, 38, 37, 37, 37, 36, 30 }; /* take a look onto datasheet table 3-8 */ static const uint8_t RSSI_value[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \ @@ -268,6 +268,7 @@ int16_t mrf24j40_get_txpower(mrf24j40_t *dev) void mrf24j40_set_txpower(mrf24j40_t *dev, int16_t txpower) { uint8_t txpower_reg_value; + /* positive values are better with a conversion array */ txpower = (txpower < 0) ? -1 * txpower : txpower; txpower = (txpower > 36) ? 36 : txpower; @@ -294,6 +295,7 @@ uint8_t mrf24j40_get_csma_max_retries(mrf24j40_t *dev) void mrf24j40_set_csma_max_retries(mrf24j40_t *dev, int8_t retries) { uint8_t tmp; + /* get current register settings */ tmp = mrf24j40_reg_read_short(dev, MRF24J40_REG_TXMCR); /* clear csma bits */ @@ -311,7 +313,7 @@ int8_t mrf24j40_get_cca_threshold(mrf24j40_t *dev) { int8_t tmp; - tmp = mrf24j40_reg_read_short(dev, MRF24J40_REG_CCAEDTH); /* Energy detection threshold */ + tmp = mrf24j40_reg_read_short(dev, MRF24J40_REG_CCAEDTH); /* Energy detection threshold */ return(dBm_value[tmp]); /* in dBm */ } @@ -477,6 +479,7 @@ void mrf24j40_assert_awake(mrf24j40_t *dev) void mrf24j40_reset_state_machine(mrf24j40_t *dev) { uint8_t rfstate; + mrf24j40_reg_write_short(dev, MRF24J40_REG_RFCTL, MRF24J40_RFCTL_RFRST); mrf24j40_reg_write_short(dev, MRF24J40_REG_RFCTL, 0x00); xtimer_usleep(MRF24J40_STATE_RESET_DELAY); /* Delay at least 192us */ @@ -494,5 +497,3 @@ void mrf24j40_software_reset(mrf24j40_t *dev) softrst = mrf24j40_reg_read_short(dev, MRF24J40_REG_SOFTRST); } while (softrst != 0); /* wait until soft-reset has finished */ } - - diff --git a/drivers/mrf24j40/mrf24j40_internal.c b/drivers/mrf24j40/mrf24j40_internal.c index 38670fb14fcf4..3aae64930a681 100644 --- a/drivers/mrf24j40/mrf24j40_internal.c +++ b/drivers/mrf24j40/mrf24j40_internal.c @@ -1,3 +1,11 @@ +/* + * Copyright (C) 2017 Koen Zandberg + * + * 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 drivers_mrf24j40 * @{ @@ -22,6 +30,7 @@ void mrf24j40_init(mrf24j40_t *dev) { uint8_t softrst; uint8_t order; + mrf24j40_hardware_reset(dev); /* do a soft reset */ mrf24j40_reg_write_short(dev, MRF24J40_REG_SOFTRST, 0x7); // from manual @@ -38,21 +47,21 @@ void mrf24j40_init(mrf24j40_t *dev) mrf24j40_reg_write_short(dev, MRF24J40_REG_RXFLUSH, MRF24J40_RXFLUSH_RXFLUSH); /* Here starts init-process as described on MRF24J40 Manual Chap. 3.2 */ - mrf24j40_reg_write_short(dev, MRF24J40_REG_PACON2, ( MRF24J40_PACON2_TXONTS2 | - MRF24J40_PACON2_TXONTS1 | - MRF24J40_PACON2_FIFOEN) ); - mrf24j40_reg_write_short(dev, MRF24J40_REG_TXSTBL, ( MRF24J40_TXSTBL_RFSTBL3 | - MRF24J40_TXSTBL_RFSTBL0 | - MRF24J40_TXSTBL_MSIFS2 | - MRF24J40_TXSTBL_MSIFS0 )); + mrf24j40_reg_write_short(dev, MRF24J40_REG_PACON2, (MRF24J40_PACON2_TXONTS2 | + MRF24J40_PACON2_TXONTS1 | + MRF24J40_PACON2_FIFOEN)); + mrf24j40_reg_write_short(dev, MRF24J40_REG_TXSTBL, (MRF24J40_TXSTBL_RFSTBL3 | + MRF24J40_TXSTBL_RFSTBL0 | + MRF24J40_TXSTBL_MSIFS2 | + MRF24J40_TXSTBL_MSIFS0)); mrf24j40_reg_write_long(dev, MRF24J40_REG_RFCON1, MRF24J40_RFCON1_VCOOPT1); mrf24j40_reg_write_long(dev, MRF24J40_REG_RFCON2, MRF24J40_RFCON2_PLLEN); - mrf24j40_reg_write_long(dev, MRF24J40_REG_RFCON6, ( MRF24J40_RFCON6_TXFIL | - MRF24J40_RFCON6_20MRECVR )); + mrf24j40_reg_write_long(dev, MRF24J40_REG_RFCON6, (MRF24J40_RFCON6_TXFIL | + MRF24J40_RFCON6_20MRECVR)); mrf24j40_reg_write_long(dev, MRF24J40_REG_RFCON7, MRF24J40_RFCON7_SLPCLKSEL1 ); mrf24j40_reg_write_long(dev, MRF24J40_REG_RFCON8, MRF24J40_RFCON8_RFVCO ); - mrf24j40_reg_write_long(dev, MRF24J40_REG_SLPCON1, ( MRF24J40_SLPCON1_CLKOUTEN | - MRF24J40_SLPCON1_SLPCLKDIV0 )); + mrf24j40_reg_write_long(dev, MRF24J40_REG_SLPCON1, (MRF24J40_SLPCON1_CLKOUTEN | + MRF24J40_SLPCON1_SLPCLKDIV0)); mrf24j40_reg_write_short(dev, MRF24J40_REG_BBREG2, MRF25J40_BBREG2_CCAMODE1 ); mrf24j40_reg_write_short(dev, MRF24J40_REG_CCAEDTH, 0x60); mrf24j40_reg_write_short(dev, MRF24J40_REG_BBREG6, MRF24J40_BBREG6_RSSIMODE2 ); @@ -69,7 +78,7 @@ void mrf24j40_init(mrf24j40_t *dev) mrf24j40_reg_read_short(dev, MRF24J40_REG_INTSTAT); /* mrf24j40_set_interrupts */ - mrf24j40_reg_write_short(dev, MRF24J40_REG_INTCON, ~( MRF24J40_INTCON_RXIE | MRF24J40_INTCON_TXNIE )); + mrf24j40_reg_write_short(dev, MRF24J40_REG_INTCON, ~(MRF24J40_INTCON_RXIE | MRF24J40_INTCON_TXNIE)); //Wait until the RFSTATE machine indicates RX state } @@ -200,18 +209,20 @@ void mrf24j40_reset_tasks(mrf24j40_t *dev) void mrf24j40_update_tasks(mrf24j40_t *dev) { - uint8_t instat = 0; - uint8_t newpending = 0; - if(dev->irq_flag){ + + if (dev->irq_flag) { + uint8_t newpending = 0; + uint8_t instat = 0; + dev->irq_flag = 0; instat = mrf24j40_reg_read_short(dev, MRF24J40_REG_INTSTAT); /* check if TX done */ - if(instat & MRF24J40_INTSTAT_TXNIF){ - newpending |= MRF24J40_TASK_TX_DONE |MRF24J40_TASK_TX_READY; + if (instat & MRF24J40_INTSTAT_TXNIF) { + newpending |= MRF24J40_TASK_TX_DONE | MRF24J40_TASK_TX_READY; /* transmit done, returning to configured idle state */ mrf24j40_assert_sleep(dev); } - if(instat & MRF24J40_INTSTAT_RXIF){ + if (instat & MRF24J40_INTSTAT_RXIF) { newpending |= MRF24J40_TASK_RX_READY; } /* check if RX pending */ diff --git a/drivers/mrf24j40/mrf24j40_netdev.c b/drivers/mrf24j40/mrf24j40_netdev.c index 92c239d94c98e..663823dd4886d 100644 --- a/drivers/mrf24j40/mrf24j40_netdev.c +++ b/drivers/mrf24j40/mrf24j40_netdev.c @@ -159,8 +159,8 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info) if (info != NULL) { netdev2_ieee802154_rx_info_t *radio_info = info; /* Read LQI and RSSI values from the RX fifo */ - mrf24j40_rx_fifo_read(dev, phr+1 , &(radio_info->lqi), 1); - mrf24j40_rx_fifo_read(dev, phr+2, &(radio_info->rssi), 1); + mrf24j40_rx_fifo_read(dev, phr + 1, &(radio_info->lqi), 1); + mrf24j40_rx_fifo_read(dev, phr + 2, &(radio_info->rssi), 1); } /* Turn on reception of packets off the air */ @@ -327,7 +327,7 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len) default: /* try netdev2 settings */ res = netdev2_ieee802154_get((netdev2_ieee802154_t *)netdev, opt, - val, max_len); + val, max_len); } return res; } @@ -403,8 +403,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len) uint8_t chan = ((uint8_t *)val)[0]; if (chan < MRF24J40_MIN_CHANNEL || chan > MRF24J40_MAX_CHANNEL || - dev->netdev.chan == chan) - { + dev->netdev.chan == chan) { res = -EINVAL; break; } @@ -524,8 +523,8 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len) } /* try netdev2 building flags */ if (res == -ENOTSUP) { - res = netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, opt, - val, len); + res = netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, opt, + val, len); } return res; } @@ -533,8 +532,8 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len) static void _isr(netdev2_t *netdev) { mrf24j40_t *dev = (mrf24j40_t *) netdev; + #ifdef MODULE_NETSTATS_L2 - uint8_t txstat; #endif /* update pending bits */ @@ -546,23 +545,23 @@ static void _isr(netdev2_t *netdev) DEBUG("[mrf24j40] EVT - TX_END\n"); #ifdef MODULE_NETSTATS_L2 if (netdev->event_callback && (dev->netdev.flags & MRF24J40_OPT_TELL_TX_END)) { - txstat = mrf24j40_reg_read_short(dev, MRF24J40_REG_TXSTAT); - /* transmision failed */ - if (txstat & MRF24J40_TXSTAT_TXNSTAT) { - /* TX_NOACK - CCAFAIL */ - if (txstat & MRF24J40_TXSTAT_CCAFAIL) { - netdev->event_callback(netdev, NETDEV2_EVENT_TX_MEDIUM_BUSY); - DEBUG("[mrf24j40] TX_CHANNEL_ACCESS_FAILURE\n"); - } - /* check max retries */ - else if (txstat & 0xc0) { - netdev->event_callback(netdev, NETDEV2_EVENT_TX_NOACK); - DEBUG("[mrf24j40] TX NO_ACK\n"); - } - } - else { - netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE); - } + uint8_t txstat = mrf24j40_reg_read_short(dev, MRF24J40_REG_TXSTAT); + /* transmision failed */ + if (txstat & MRF24J40_TXSTAT_TXNSTAT) { + /* TX_NOACK - CCAFAIL */ + if (txstat & MRF24J40_TXSTAT_CCAFAIL) { + netdev->event_callback(netdev, NETDEV2_EVENT_TX_MEDIUM_BUSY); + DEBUG("[mrf24j40] TX_CHANNEL_ACCESS_FAILURE\n"); + } + /* check max retries */ + else if (txstat & 0xc0) { + netdev->event_callback(netdev, NETDEV2_EVENT_TX_NOACK); + DEBUG("[mrf24j40] TX NO_ACK\n"); + } + } + else { + netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE); + } } #endif @@ -577,4 +576,3 @@ static void _isr(netdev2_t *netdev) } // end of RXIF check DEBUG("[mrf24j40] END IRQ\n"); } - diff --git a/sys/auto_init/netif/auto_init_mrf24j40.c b/sys/auto_init/netif/auto_init_mrf24j40.c index cf12d357873df..ca19ac68a399b 100644 --- a/sys/auto_init/netif/auto_init_mrf24j40.c +++ b/sys/auto_init/netif/auto_init_mrf24j40.c @@ -49,7 +49,7 @@ void auto_init_mrf24j40(void) int res; DEBUG("Initializing MRF24J40 radio at SPI_%i\n", p->spi); - mrf24j40_setup(&mrf24j40_devs[i], (mrf24j40_params_t*) p); + mrf24j40_setup(&mrf24j40_devs[i], (mrf24j40_params_t *) p); res = gnrc_netdev2_ieee802154_init(&gnrc_adpt[i], (netdev2_ieee802154_t *)&mrf24j40_devs[i]);