diff --git a/tests/driver_kw2xrf/Makefile b/tests/driver_kw2xrf/Makefile index 20e2a1132d02d..24683ad5a6fd4 100644 --- a/tests/driver_kw2xrf/Makefile +++ b/tests/driver_kw2xrf/Makefile @@ -4,49 +4,14 @@ include ../Makefile.tests_common FEATURES_REQUIRED = periph_spi periph_gpio BOARD_INSUFFICIENT_MEMORY := stm32f0discovery nucleo-f334 weio -# msba2 fails with linker error in cc110x USEMODULE += auto_init_gnrc_netif -USEMODULE += gnrc_netif -USEMODULE += gnrc_txtsnd -USEMODULE += gnrc_nomac USEMODULE += gnrc_netdev_default -USEMODULE += gnrc_pktdump USEMODULE += shell USEMODULE += shell_commands USEMODULE += ps -# define parameters for selected boards -ifneq (,$(filter pba-d-01-kw2x,$(BOARD))) - DRIVER := kw2xrf - USE_BOARD_PARAMETERS := true -endif - -# only set specific parameters if not using board configuration -ifneq (true,$(USE_BOARD_PARAMETERS)) - - # set default device parameters in case they are undefined - DRIVER ?= kw2xrf - KW2XRF_SHARED_SPI ?= 1 - KWRF_SPI ?= SPI_DEV\(0\) - KWRF_SPI_SPEED ?= SPI_CLK_5MHZ - KWRF_CS ?= GPIO_PIN\(0,0\) - KWRF_INT ?= GPIO_PIN\(0,1\) - - # export parameters - CFLAGS += -DKW2XRF_SHARED_SPI=$(KW2XRF_SHARED_SPI) - CFLAGS += -DKWRF_SPI=$(KWRF_SPI) - CFLAGS += -DKWRF_SPI_SPEED=$(KWRF_SPI_SPEED) - CFLAGS += -DKWRF_CS=$(KWRF_CS) - CFLAGS += -DKWRF_INT=$(KWRF_INT) - - # This adds . to include path so generic kw2xrf_params.h gets picked - # up. All boards actually having such a device on board should define - # USE_BOARD_PARAMETERS=true above to skip this step, as the board provides - # this header. - CFLAGS += -I$(CURDIR) - -endif +DRIVER ?= kw2xrf # finally include the actual chosen driver USEMODULE += $(DRIVER) diff --git a/tests/driver_kw2xrf/README.md b/tests/driver_kw2xrf/README.md index 9a237d983eab3..ea1ba44fe0ff9 100644 --- a/tests/driver_kw2xrf/README.md +++ b/tests/driver_kw2xrf/README.md @@ -1,12 +1,10 @@ # About -This is a manual test application for testing the KW2xrf network device driver. +This is a manual test application for testing the KW2XRF device driver. It enables several shell commands, allowing for special test modes of that device. Without deeper knowledge about the hardware, this application might be useless except for compile tests. If you want an example to use this radio, check the [examples](../../examples) folder. For running this test, you need to connect/configure the following pins of your -radio device: +radio device. If you are running on a phyNODE, this is already the on-board default. + - SPI DEV - CS (chip select) - INT (external interrupt) -# Usage -For testing the radio driver you can use the netif and txtsnd shell commands -that are included in this application. diff --git a/tests/driver_kw2xrf/main.c b/tests/driver_kw2xrf/main.c index 668139b9ae56d..c9f74a3de1070 100644 --- a/tests/driver_kw2xrf/main.c +++ b/tests/driver_kw2xrf/main.c @@ -23,11 +23,12 @@ #include "kw2xrf.h" #include "shell_commands.h" #include "net/gnrc.h" -#include "net/gnrc/pktdump.h" #include "net/gnrc/netif.h" #include "net/gnrc/netapi.h" #include "net/netopt.h" +#define KW2XRF_TESTMODE (1) + #ifdef KW2XRF_TESTMODE #include "kw2xrf_tm.h" @@ -159,15 +160,9 @@ static const shell_command_t shell_commands[] = { int main(void) { - gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL, - gnrc_pktdump_pid); puts("KW2XRF device driver test"); - /* register the pktdump thread */ - puts("Register the packet dump thread for GNRC_NETTYPE_UNDEF packets"); - gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump); - /* start the shell */ puts("Initialization successful - starting the shell now");