From cb5819fe65680746714defdd0e2f769bed50e52f Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Mon, 25 Jan 2016 00:09:47 +0100 Subject: [PATCH] auto_init: adapt autoinitialization of at86rf2xx --- sys/auto_init/netif/auto_init_at86rf2xx.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sys/auto_init/netif/auto_init_at86rf2xx.c b/sys/auto_init/netif/auto_init_at86rf2xx.c index 7a6714bcbf36d..44689c4cc93aa 100644 --- a/sys/auto_init/netif/auto_init_at86rf2xx.c +++ b/sys/auto_init/netif/auto_init_at86rf2xx.c @@ -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]; @@ -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");