diff --git a/tests/candev/Makefile b/tests/candev/Makefile index 7ffdba6b5a..e6b1cd43ee 100644 --- a/tests/candev/Makefile +++ b/tests/candev/Makefile @@ -1,20 +1,16 @@ include ../Makefile.tests_common -# the test currently only works with can_linux, so on "native" -BOARD_WHITELIST := native - USEMODULE += shell USEMODULE += can USEMODULE += isrpipe +FEATURES_OPTIONAL += periph_can + # define the CAN driver you want to use here -CAN_DRIVER ?= CAN_NATIVE +CAN_DRIVER ?= CAN_EXT -ifeq ($(CAN_DRIVER), PERIPH_CAN) -# periph_can modules/variables go here - -else ifeq ($(CAN_DRIVER), CAN_NATIVE) -# can_native modules/variables go here +ifeq ($(CAN_DRIVER), CAN_EXT) +# external CAN driver modules/variables go here endif diff --git a/tests/candev/main.c b/tests/candev/main.c index 57c5570a2b..21c29d724e 100644 --- a/tests/candev/main.c +++ b/tests/candev/main.c @@ -30,11 +30,12 @@ #include "shell.h" #include "can/device.h" -#if IS_USED(MODULE_CAN_LINUX) +#if IS_USED(MODULE_PERIPH_CAN) -#include +#include "periph/can.h" +#include "can_params.h" -static can_t linux_dev; +static can_t periph_dev; #else /* add other candev drivers here */ @@ -192,10 +193,10 @@ int main(void) puts("candev test application\n"); isrpipe_init(&rxbuf, (uint8_t *)rx_ringbuf, sizeof(rx_ringbuf)); -#if IS_USED(MODULE_CAN_LINUX) - puts("Initializing Linux Can device"); - can_init( &linux_dev, &(candev_conf[0])); /* vcan0 */ - candev = (candev_t *)&linux_dev; +#if IS_USED(MODULE_PERIPH_CAN) + puts("Initializing CAN periph device"); + can_init(&periph_dev, &(candev_conf[0])); /* vcan0 on native */ + candev = (candev_t *)&periph_dev; #else /* add initialization for other candev drivers here */ #endif