Skip to content

Commit

Permalink
tests/ieee802154_hal: add nrf802154
Browse files Browse the repository at this point in the history
  • Loading branch information
jia200x committed Sep 4, 2020
1 parent 0ffd69a commit 1002b64
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/ieee802154_hal/init_devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,20 @@
#include "cc2538_rf.h"
#endif

#ifdef MODULE_NRF802154
#include "nrf802154.h"
#endif

#ifdef MODULE_CC2538_RF
extern ieee802154_dev_t cc2538_rf_dev;
#endif

#define RADIOS_NUMOF IS_USED(MODULE_CC2538_RF)
#ifdef MODULE_NRF802154
extern ieee802154_dev_t nrf802154_hal_dev;
#endif

#define RADIOS_NUMOF IS_USED(MODULE_CC2538_RF) + \
IS_USED(MODULE_NRF802154)

#if RADIOS_NUMOF == 0
#error "Radio is not supported"
Expand All @@ -46,6 +55,10 @@ static void _register_radios(void)
_radios[i++] = &cc2538_rf_dev;
#endif

#ifdef MODULE_NRF802154
_radios[i++] = &nrf802154_hal_dev;
#endif

assert(i == RADIOS_NUMOF);
}

Expand All @@ -59,6 +72,10 @@ void ieee802154_hal_test_init_devs(void)
#ifdef MODULE_CC2538_RF
cc2538_init();
#endif

#ifdef MODULE_NRF802154
nrf802154_init();
#endif
}

ieee802154_dev_t *ieee802154_hal_test_get_dev(int id)
Expand Down

0 comments on commit 1002b64

Please sign in to comment.