Skip to content

Commit

Permalink
auto_init: adapt autoinitialization of at86rf2xx
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Jan 24, 2016
1 parent 21b8558 commit cb5819f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions sys/auto_init/netif/auto_init_at86rf2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define AT86RF2XX_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define AT86RF2XX_MAC_PRIO (THREAD_PRIORITY_MAIN - 4)

#define AT86RF2XX_NUM (sizeof(at86rf2xx_params)/sizeof(at86rf2xx_params[0]))
#define AT86RF2XX_NUM (sizeof(at86rf2xx_params) / sizeof(at86rf2xx_params[0]))

static at86rf2xx_t at86rf2xx_devs[AT86RF2XX_NUM];
static char _nomac_stacks[AT86RF2XX_MAC_STACKSIZE][AT86RF2XX_NUM];
Expand All @@ -46,13 +46,10 @@ void auto_init_at86rf2xx(void)
for (unsigned i = 0; i < AT86RF2XX_NUM; i++) {
DEBUG("Initializing AT86RF2xx radio at SPI_%i\n", i);
const at86rf2xx_params_t *p = &at86rf2xx_params[i];
int res = at86rf2xx_init(&at86rf2xx_devs[i],
p->spi,
p->spi_speed,
p->cs_pin,
p->int_pin,
p->sleep_pin,
p->reset_pin);
int res;
at86rf2xx_setup(&at86rf2xx_devs[i], p->spi, p->spi_speed, p->cs_pin,
p->int_pin, p->sleep_pin, p->reset_pin);
res = at86rf2xx_devs[i].driver->init(&at86rf2xx_devs[i]);

if (res < 0) {
DEBUG("Error initializing AT86RF2xx radio device!\n");
Expand Down

0 comments on commit cb5819f

Please sign in to comment.