Skip to content

Commit 11aa1cd

Browse files
committed
samr21-xpro: use lwmac by default for testing
1 parent 5fce410 commit 11aa1cd

3 files changed

Lines changed: 65 additions & 18 deletions

File tree

boards/samr21-xpro/Makefile.dep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE)))
22
USEMODULE += at86rf233
3+
USEMODULE += gnrc_lwmac
34
endif
45

56
ifneq (,$(filter saul_default,$(USEMODULE)))

sys/auto_init/netif/auto_init_at86rf2xx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "board.h"
2323
#include "net/gnrc/netdev2.h"
2424
#include "net/gnrc/netdev2/ieee802154.h"
25+
#include "net/gnrc/lwmac/lwmac.h"
2526
#include "net/gnrc.h"
2627

2728
#include "at86rf2xx.h"
@@ -58,10 +59,10 @@ void auto_init_at86rf2xx(void)
5859
DEBUG("Error initializing AT86RF2xx radio device!\n");
5960
}
6061
else {
61-
gnrc_netdev2_init(_at86rf2xx_stacks[i],
62+
gnrc_lwmac_init(_at86rf2xx_stacks[i],
6263
AT86RF2XX_MAC_STACKSIZE,
6364
AT86RF2XX_MAC_PRIO,
64-
"at86rf2xx",
65+
"at86rf2xx-lwmac",
6566
&gnrc_adpt[i]);
6667
}
6768
}

tests/driver_at86rf2xx/Makefile

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,77 @@
11
APPLICATION = driver_at86rf2xx
22
include ../Makefile.tests_common
33

4-
FEATURES_REQUIRED = periph_spi periph_gpio
4+
BOARD=samr21-xpro
55

6-
DISABLE_MODULE += auto_init
6+
FEATURES_REQUIRED = periph_spi periph_gpio
77

8-
USEMODULE += od
9-
USEMODULE += shell
10-
USEMODULE += shell_commands
11-
USEMODULE += ps
8+
BOARD_INSUFFICIENT_MEMORY := stm32f0discovery
9+
BOARD_BLACKLIST := nucleo-f334
10+
# nucleo-f334: not enough GPIO pins defined
1211

13-
# define the driver to be used for selected boards
1412
ifneq (,$(filter samr21-xpro,$(BOARD)))
15-
DRIVER := at86rf233
13+
DRIVER ?= at86rf233
14+
USE_BOARD_PARAMETERS:=false
1615
endif
17-
ifneq (,$(filter iotlab-m3 fox,$(BOARD)))
18-
DRIVER := at86rf231
16+
ifneq (,$(filter iotlab-m3,$(BOARD)))
17+
DRIVER ?= at86rf231
18+
USE_BOARD_PARAMETERS:=true
1919
endif
20-
ifneq (,$(filter mulle,$(BOARD)))
21-
DRIVER := at86rf212b
20+
21+
ifneq (,$(DRIVER))
22+
USEMODULE += $(DRIVER)
23+
else
24+
# default to at86rf231
25+
USEMODULE += at86rf231
2226
endif
2327

24-
# use the at86rf231 as fallback device
25-
DRIVER ?= at86rf231
28+
ifneq (true,$(USE_BOARD_PARAMETERS))
29+
# This adds . to include path so generic at86rf2xx_params.h gets picked
30+
# up. All boards actually having such a device on board should define
31+
# USE_BOARD_PARAMETERS=true above to skip this step, as the board provides
32+
# this header.
33+
CFLAGS += -I$(CURDIR)
2634

27-
# include the selected driver
28-
USEMODULE += $(DRIVER)
35+
ifneq (,$(ATRF_SPI))
36+
CFLAGS += -DATRF_SPI=$(ATRF_SPI)
37+
else
38+
CFLAGS += -DATRF_SPI=SPI_0 # set default
39+
endif
40+
ifneq (,$(ATRF_CS))
41+
CFLAGS += -DATRF_CS=$(ATRF_CS)
42+
else
43+
CFLAGS += -DATRF_CS="GPIO_PIN(PB, 31)" # set default
44+
endif
45+
ifneq (,$(ATRF_INT))
46+
CFLAGS += -DATRF_INT=$(ATRF_INT)
47+
else
48+
CFLAGS += -DATRF_INT="GPIO_PIN(PB, 0)" # set default
49+
endif
50+
ifneq (,$(ATRF_SLEEP))
51+
CFLAGS += -DATRF_SLEEP=$(ATRF_SLEEP)
52+
else
53+
CFLAGS += -DATRF_SLEEP="GPIO_PIN(PA, 20)" # set default
54+
endif
55+
ifneq (,$(ATRF_RESET))
56+
CFLAGS += -DATRF_RESET=$(ATRF_RESET)
57+
else
58+
CFLAGS += -DATRF_RESET="GPIO_PIN(PB, 15)" # set default
59+
endif
60+
ifneq (,$(ATRF_SPI_SPEED))
61+
CFLAGS += -DATRF_SPI_SPEED=$(ATRF_SPI_SPEED)
62+
endif
63+
64+
endif # USE_BOARD_PARAMETERS=false
65+
66+
USEMODULE += auto_init_gnrc_netif
67+
USEMODULE += gnrc_netif
68+
USEMODULE += gnrc_lwmac
69+
USEMODULE += gnrc_pktdump
70+
USEMODULE += shell
71+
USEMODULE += shell_commands
72+
USEMODULE += ps
2973

3074
CFLAGS += -DDEVELHELP
75+
CFLAGS += -fdiagnostics-color=auto
3176

3277
include $(RIOTBASE)/Makefile.include

0 commit comments

Comments
 (0)