diff --git a/drivers/dose/dose.c b/drivers/dose/dose.c index 440c5aee18..65c1b103bf 100644 --- a/drivers/dose/dose.c +++ b/drivers/dose/dose.c @@ -36,7 +36,7 @@ static dose_signal_t state_transit_blocked(dose_t *ctx, dose_signal_t signal); static dose_signal_t state_transit_idle(dose_t *ctx, dose_signal_t signal); static dose_signal_t state_transit_recv(dose_t *ctx, dose_signal_t signal); static dose_signal_t state_transit_send(dose_t *ctx, dose_signal_t signal); -static void state(dose_t *ctx, uint8_t src); +static void state(dose_t *ctx, dose_signal_t src); static void _isr_uart(void *arg, uint8_t c); static void _isr_gpio(void *arg); static void _isr_xtimer(void *arg); diff --git a/tests/driver_at86rf215/Makefile b/tests/driver_at86rf215/Makefile index b6dd4a1296..77c4b02985 100644 --- a/tests/driver_at86rf215/Makefile +++ b/tests/driver_at86rf215/Makefile @@ -1,27 +1,6 @@ BOARD ?= openmote-b -include ../Makefile.tests_common - -# Modules to include: -USEMODULE += shell -USEMODULE += shell_commands -USEMODULE += ps # the radio driver to test USEMODULE += at86rf215 -# gnrc is a meta module including all required, basic gnrc networking modules -USEMODULE += gnrc - -# automatically initialize the network interface -USEMODULE += auto_init_gnrc_netif - -# shell command to send L2 packets with a simple string -USEMODULE += gnrc_txtsnd - -# the application dumps received packets to stdout -USEMODULE += gnrc_pktdump - -include $(RIOTBASE)/Makefile.include - -# Set a custom channel if needed -include $(RIOTMAKE)/default-radio-settings.inc.mk +include ../driver_netdev_common/Makefile diff --git a/tests/driver_at86rf215/main.c b/tests/driver_at86rf215/main.c deleted file mode 100644 index 66cc2bd986..0000000000 --- a/tests/driver_at86rf215/main.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2020 ML!PA Consulting GmbH - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup tests - * @{ - * - * @file - * @brief Test application for network device drivers - * - * @author Benjamin Valentin - * @} - */ - -#include "thread.h" -#include "shell.h" -#include "shell_commands.h" - -#include "net/gnrc/pktdump.h" -#include "net/gnrc.h" - -int main(void) -{ - /* enable pktdump output */ - gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL, - gnrc_pktdump_pid); - gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump); - - /* start the shell */ - char line_buf[SHELL_DEFAULT_BUFSIZE]; - shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); - - return 0; -} diff --git a/tests/driver_at86rf215/main.c b/tests/driver_at86rf215/main.c new file mode 120000 index 0000000000..a3f88db08e --- /dev/null +++ b/tests/driver_at86rf215/main.c @@ -0,0 +1 @@ +../driver_netdev_common/main.c \ No newline at end of file diff --git a/tests/driver_dose/Makefile b/tests/driver_dose/Makefile new file mode 100644 index 0000000000..4f91014003 --- /dev/null +++ b/tests/driver_dose/Makefile @@ -0,0 +1,4 @@ +# the driver to test +USEMODULE = dose + +include ../driver_netdev_common/Makefile diff --git a/tests/driver_dose/Makefile.ci b/tests/driver_dose/Makefile.ci new file mode 100644 index 0000000000..2bfb79fe6c --- /dev/null +++ b/tests/driver_dose/Makefile.ci @@ -0,0 +1,21 @@ +BOARD_INSUFFICIENT_MEMORY := \ + arduino-duemilanove \ + arduino-leonardo \ + arduino-mega2560 \ + arduino-uno \ + atmega328p \ + i-nucleo-lrwan1 \ + msb-430 \ + msb-430h \ + nucleo-f030r8 \ + nucleo-f031k6 \ + nucleo-f042k6 \ + nucleo-f303k8 \ + nucleo-f334r8 \ + nucleo-l031k6 \ + nucleo-l053r8 \ + stm32f030f4-demo \ + stm32f0discovery \ + stm32l0538-disco \ + waspmote-pro \ + # diff --git a/tests/driver_dose/main.c b/tests/driver_dose/main.c new file mode 120000 index 0000000000..a3f88db08e --- /dev/null +++ b/tests/driver_dose/main.c @@ -0,0 +1 @@ +../driver_netdev_common/main.c \ No newline at end of file diff --git a/tests/driver_mrf24j40/Makefile b/tests/driver_mrf24j40/Makefile new file mode 100644 index 0000000000..bfcf1c8067 --- /dev/null +++ b/tests/driver_mrf24j40/Makefile @@ -0,0 +1,4 @@ +# the radio driver to test +USEMODULE = mrf24j40md + +include ../driver_netdev_common/Makefile diff --git a/tests/driver_mrf24j40/Makefile.ci b/tests/driver_mrf24j40/Makefile.ci new file mode 100644 index 0000000000..7b6a49c3a0 --- /dev/null +++ b/tests/driver_mrf24j40/Makefile.ci @@ -0,0 +1,16 @@ +BOARD_INSUFFICIENT_MEMORY := \ + arduino-duemilanove \ + arduino-leonardo \ + arduino-mega2560 \ + arduino-uno \ + atmega328p \ + i-nucleo-lrwan1 \ + nucleo-f031k6 \ + nucleo-f042k6 \ + nucleo-l031k6 \ + nucleo-l053r8 \ + stm32f030f4-demo \ + stm32f0discovery \ + stm32l0538-disco \ + waspmote-pro \ + # diff --git a/tests/driver_mrf24j40/main.c b/tests/driver_mrf24j40/main.c new file mode 120000 index 0000000000..a3f88db08e --- /dev/null +++ b/tests/driver_mrf24j40/main.c @@ -0,0 +1 @@ +../driver_netdev_common/main.c \ No newline at end of file diff --git a/tests/driver_netdev_common/Makefile b/tests/driver_netdev_common/Makefile new file mode 100644 index 0000000000..afc439312a --- /dev/null +++ b/tests/driver_netdev_common/Makefile @@ -0,0 +1,28 @@ +include ../Makefile.tests_common + +# Modules to include: +USEMODULE += shell +USEMODULE += shell_commands +USEMODULE += ps + +# allow to use a smaller packet buffer in low-PDU drivers +ifdef GNRC_PKTBUF_SIZE + CFLAGS += -DGNRC_PKTBUF_SIZE=$(GNRC_PKTBUF_SIZE) +endif + +# gnrc is a meta module including all required, basic gnrc networking modules +USEMODULE += gnrc + +# automatically initialize the network interface +USEMODULE += auto_init_gnrc_netif + +# shell command to send L2 packets with a simple string +USEMODULE += gnrc_txtsnd + +# the application dumps received packets to stdout +USEMODULE += gnrc_pktdump + +include $(RIOTBASE)/Makefile.include + +# Set a custom channel if needed +include $(RIOTMAKE)/default-radio-settings.inc.mk diff --git a/tests/driver_netdev_common/Makefile.ci b/tests/driver_netdev_common/Makefile.ci new file mode 100644 index 0000000000..f183d55718 --- /dev/null +++ b/tests/driver_netdev_common/Makefile.ci @@ -0,0 +1,17 @@ +BOARD_INSUFFICIENT_MEMORY := \ + arduino-duemilanove \ + arduino-leonardo \ + arduino-mega2560 \ + arduino-uno \ + atmega328p \ + i-nucleo-lrwan1 \ + nucleo-f030r8 \ + nucleo-f031k6 \ + nucleo-f042k6 \ + nucleo-l031k6 \ + nucleo-l053r8 \ + stm32f030f4-demo \ + stm32f0discovery \ + stm32l0538-disco \ + waspmote-pro \ + # diff --git a/tests/driver_netdev_common/main.c b/tests/driver_netdev_common/main.c new file mode 100644 index 0000000000..66cc2bd986 --- /dev/null +++ b/tests/driver_netdev_common/main.c @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2020 ML!PA Consulting GmbH + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @ingroup tests + * @{ + * + * @file + * @brief Test application for network device drivers + * + * @author Benjamin Valentin + * @} + */ + +#include "thread.h" +#include "shell.h" +#include "shell_commands.h" + +#include "net/gnrc/pktdump.h" +#include "net/gnrc.h" + +int main(void) +{ + /* enable pktdump output */ + gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL, + gnrc_pktdump_pid); + gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump); + + /* start the shell */ + char line_buf[SHELL_DEFAULT_BUFSIZE]; + shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); + + return 0; +} diff --git a/tests/driver_w5100/Makefile b/tests/driver_w5100/Makefile new file mode 100644 index 0000000000..ef251dd235 --- /dev/null +++ b/tests/driver_w5100/Makefile @@ -0,0 +1,4 @@ +# the driver to test +USEMODULE = w5100 + +include ../driver_netdev_common/Makefile diff --git a/tests/driver_w5100/Makefile.ci b/tests/driver_w5100/Makefile.ci new file mode 100644 index 0000000000..2bfb79fe6c --- /dev/null +++ b/tests/driver_w5100/Makefile.ci @@ -0,0 +1,21 @@ +BOARD_INSUFFICIENT_MEMORY := \ + arduino-duemilanove \ + arduino-leonardo \ + arduino-mega2560 \ + arduino-uno \ + atmega328p \ + i-nucleo-lrwan1 \ + msb-430 \ + msb-430h \ + nucleo-f030r8 \ + nucleo-f031k6 \ + nucleo-f042k6 \ + nucleo-f303k8 \ + nucleo-f334r8 \ + nucleo-l031k6 \ + nucleo-l053r8 \ + stm32f030f4-demo \ + stm32f0discovery \ + stm32l0538-disco \ + waspmote-pro \ + # diff --git a/tests/driver_w5100/main.c b/tests/driver_w5100/main.c new file mode 120000 index 0000000000..a3f88db08e --- /dev/null +++ b/tests/driver_w5100/main.c @@ -0,0 +1 @@ +../driver_netdev_common/main.c \ No newline at end of file diff --git a/tests/driver_xbee/Makefile b/tests/driver_xbee/Makefile index 7c0ccc329b..73ee157281 100644 --- a/tests/driver_xbee/Makefile +++ b/tests/driver_xbee/Makefile @@ -1,18 +1,6 @@ -include ../Makefile.tests_common - USEMODULE += xbee -USEMODULE += gnrc_txtsnd -USEMODULE += auto_init_gnrc_netif -USEMODULE += gnrc_pktdump -USEMODULE += shell -USEMODULE += shell_commands # No need of big buffer for this test -CFLAGS += -DGNRC_PKTBUF_SIZE=512 +GNRC_PKTBUF_SIZE=512 -# add current directory to the include path. Putting it in CFLAGS will make -# it go to the beginning, before the standard includes. -# That way xbee_params.h get's included and auto configuration can pick it up. -CFLAGS += -I$(CURDIR) - -include $(RIOTBASE)/Makefile.include +include ../driver_netdev_common/Makefile diff --git a/tests/driver_xbee/main.c b/tests/driver_xbee/main.c deleted file mode 100644 index 06b0ca4acf..0000000000 --- a/tests/driver_xbee/main.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup tests - * @{ - * - * @file - * @brief Test application for Xbee S1 network device driver - * - * @author Hauke Petersen - * - * @} - */ - -#include - -#include "shell.h" -#include "shell_commands.h" -#include "net/gnrc.h" -#include "net/gnrc/pktdump.h" - -/** - * @brief Maybe you are a golfer?! - */ -int main(void) -{ - gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL, - gnrc_pktdump_pid); - - puts("Xbee S1 device driver test"); - - /* initialize and register pktdump */ - if (gnrc_pktdump_pid <= KERNEL_PID_UNDEF) { - puts("Error starting pktdump thread"); - return -1; - } - gnrc_netreg_register(GNRC_NETTYPE_UNDEF, &dump); - - /* start the shell */ - puts("Initialization OK, starting shell now"); - - char line_buf[SHELL_DEFAULT_BUFSIZE]; - shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE); - - return 0; -} diff --git a/tests/driver_xbee/main.c b/tests/driver_xbee/main.c new file mode 120000 index 0000000000..a3f88db08e --- /dev/null +++ b/tests/driver_xbee/main.c @@ -0,0 +1 @@ +../driver_netdev_common/main.c \ No newline at end of file