From 7cea2f536ea510c1467af932fb2d53c95b75798d Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:02:18 +0200 Subject: [PATCH 01/10] tests/periph_gpio: let build fail without GPIO --- tests/periph_gpio/main.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/periph_gpio/main.c b/tests/periph_gpio/main.c index fdd0690131..f9955f2c3a 100644 --- a/tests/periph_gpio/main.c +++ b/tests/periph_gpio/main.c @@ -25,9 +25,6 @@ #include "periph/gpio.h" #include "hwtimer.h" -/* only compile this if at least one GPIO device is defined */ -#if GPIO_NUMOF - uint32_t state = 0; uint32_t old_state = 0; @@ -93,14 +90,3 @@ int main(void) return 0; } - -#else - -int main(void) -{ - puts("No low-level GPIO device defined for this platform."); - - return 0; -} - -#endif /* GPIO_NUMOF */ From 2cb8ea672aceb6085f0a6055a4684f75dfbdbeb0 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:06:45 +0200 Subject: [PATCH 02/10] tests/periph_gpio_exti: let build fail w/o GPIO --- tests/periph_gpio_exti/main.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/periph_gpio_exti/main.c b/tests/periph_gpio_exti/main.c index 1b17e46e8e..ade3a22b11 100644 --- a/tests/periph_gpio_exti/main.c +++ b/tests/periph_gpio_exti/main.c @@ -24,9 +24,6 @@ #include "periph_conf.h" #include "periph/gpio.h" -/* only compile this if at least one GPIO device is defined */ -#if GPIO_NUMOF - #define ACTIVE_FLANK GPIO_RISING #define PULL GPIO_NOPULL @@ -187,14 +184,3 @@ int main(void) return 0; } - -#else - -int main(void) -{ - puts("No low-level GPIO device defined for this platform."); - - return 0; -} - -#endif /* GPIO_NUMOF */ From b3ecfd0a6e3f45a7d22fe6d9933f786c9f9e28a5 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:12:53 +0200 Subject: [PATCH 03/10] make: introduce and use periph_pwm feature --- boards/msba2/Makefile.features | 2 +- boards/stm32f4discovery/Makefile.features | 2 +- tests/periph_pwm/Makefile | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/boards/msba2/Makefile.features b/boards/msba2/Makefile.features index 762734b956..75b005a0cb 100644 --- a/boards/msba2/Makefile.features +++ b/boards/msba2/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = transceiver +FEATURES_PROVIDED = transceiver periph_pwm diff --git a/boards/stm32f4discovery/Makefile.features b/boards/stm32f4discovery/Makefile.features index 9ac4a53d6b..770036f5e7 100644 --- a/boards/stm32f4discovery/Makefile.features +++ b/boards/stm32f4discovery/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_spi +FEATURES_PROVIDED = periph_gpio periph_spi periph_pwm diff --git a/tests/periph_pwm/Makefile b/tests/periph_pwm/Makefile index bc2e352ffe..4c1404fbc8 100644 --- a/tests/periph_pwm/Makefile +++ b/tests/periph_pwm/Makefile @@ -1,9 +1,7 @@ export APPLICATION = periph_pwm include ../Makefile.tests_common -BOARD_BLACKLIST := chronos mbed_lpc1768 msb-430 msb-430h native qemu-i386 redbee-econotag telosb \ - wsn430-v1_3b wsn430-v1_4 z1 -# all listed boards: no periph_conf.h defined, +FEATURES_REQUIRED = periph_pwm USEMODULE += vtimer DISABLE_MODULE += auto_init From 95884c1a30875d6c54cd6f9fed26f7a442fb5d53 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:13:27 +0200 Subject: [PATCH 04/10] tests/periph_pwm: let build fail w/o PWM --- tests/periph_pwm/main.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/periph_pwm/main.c b/tests/periph_pwm/main.c index a3e4b3c313..7e66c76922 100644 --- a/tests/periph_pwm/main.c +++ b/tests/periph_pwm/main.c @@ -30,9 +30,6 @@ #include "vtimer.h" #include "periph/pwm.h" -/* only compile this test if PWM devices are defined */ -#if PWM_NUMOF - #define WAIT (10000) #define STEP (10) @@ -77,15 +74,3 @@ int main(void) return 0; } - -#else - -int main(void) -{ - puts("\nRIOT PWM test"); - puts("There are no PWM devices defined for this board!"); - - return 0; -} - -#endif /* PWM_NUMOF */ From 3b52057fe51f2c1f2bf0916a11a5299c9cef7d46 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:18:53 +0200 Subject: [PATCH 05/10] make: introduce and use periph_random feature --- boards/arduino-due/Makefile.features | 2 +- boards/cc2538dk/Makefile.features | 2 +- boards/pca10000/Makefile.features | 2 +- boards/pca10005/Makefile.features | 2 +- boards/stm32f4discovery/Makefile.features | 2 +- boards/yunjia-nrf51822/Makefile.features | 2 +- tests/periph_random/Makefile | 4 +--- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/boards/arduino-due/Makefile.features b/boards/arduino-due/Makefile.features index 9ac4a53d6b..9b7846ee4a 100644 --- a/boards/arduino-due/Makefile.features +++ b/boards/arduino-due/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_spi +FEATURES_PROVIDED = periph_gpio periph_spi periph_random diff --git a/boards/cc2538dk/Makefile.features b/boards/cc2538dk/Makefile.features index 0f33fa5629..a326030628 100644 --- a/boards/cc2538dk/Makefile.features +++ b/boards/cc2538dk/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio +FEATURES_PROVIDED = periph_gpio periph_random diff --git a/boards/pca10000/Makefile.features b/boards/pca10000/Makefile.features index 0f33fa5629..a326030628 100644 --- a/boards/pca10000/Makefile.features +++ b/boards/pca10000/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio +FEATURES_PROVIDED = periph_gpio periph_random diff --git a/boards/pca10005/Makefile.features b/boards/pca10005/Makefile.features index 0f33fa5629..a326030628 100644 --- a/boards/pca10005/Makefile.features +++ b/boards/pca10005/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio +FEATURES_PROVIDED = periph_gpio periph_random diff --git a/boards/stm32f4discovery/Makefile.features b/boards/stm32f4discovery/Makefile.features index 770036f5e7..548a0f3f4c 100644 --- a/boards/stm32f4discovery/Makefile.features +++ b/boards/stm32f4discovery/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_spi periph_pwm +FEATURES_PROVIDED = periph_gpio periph_spi periph_pwm periph_random diff --git a/boards/yunjia-nrf51822/Makefile.features b/boards/yunjia-nrf51822/Makefile.features index 0f33fa5629..a326030628 100644 --- a/boards/yunjia-nrf51822/Makefile.features +++ b/boards/yunjia-nrf51822/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio +FEATURES_PROVIDED = periph_gpio periph_random diff --git a/tests/periph_random/Makefile b/tests/periph_random/Makefile index 5bd2c194f8..7d0f3f16b8 100644 --- a/tests/periph_random/Makefile +++ b/tests/periph_random/Makefile @@ -1,9 +1,7 @@ export APPLICATION = periph_random include ../Makefile.tests_common -BOARD_BLACKLIST := chronos mbed_lpc1768 msb-430 msb-430h native qemu-i386 redbee-econotag telosb \ - wsn430-v1_3b wsn430-v1_4 z1 -# all listed boards: no periph_conf.h defined, +FEATURES_REQUIRED = periph_random USEMODULE += vtimer From d9dd5b1913e1d9de532e13be4896725839b87ad8 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:19:11 +0200 Subject: [PATCH 06/10] tests/periph_random: let build fail w/o RANDOM --- tests/periph_random/main.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/periph_random/main.c b/tests/periph_random/main.c index 90c1a2cb0b..20a49d1e5b 100644 --- a/tests/periph_random/main.c +++ b/tests/periph_random/main.c @@ -24,9 +24,6 @@ #include #include -/* only compile test if a random number generator is defined */ -#if RANDOM_NUMOF - #define LIMIT (20U) int main(void) @@ -66,14 +63,3 @@ int main(void) return 0; } - -#else - -int main(void) -{ - puts("Random number generator low-level driver test"); - puts("There is no (pseudo) random generator implementation for your platform"); - return 0; -} - -#endif /* RANDOM_NUMOF */ From 4cafe7c5a9ce7acfd3ca9f4e973c47ea995bbef1 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:24:02 +0200 Subject: [PATCH 07/10] make: introduce and use periph_rtt feature --- boards/iot-lab_M3/Makefile.features | 2 +- boards/pca10000/Makefile.features | 2 +- boards/pca10005/Makefile.features | 2 +- boards/yunjia-nrf51822/Makefile.features | 2 +- tests/periph_rtt/Makefile | 4 +--- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/boards/iot-lab_M3/Makefile.features b/boards/iot-lab_M3/Makefile.features index 0717f0e9f1..0c2220101c 100644 --- a/boards/iot-lab_M3/Makefile.features +++ b/boards/iot-lab_M3/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = transceiver periph_gpio periph_uart periph_spi periph_i2c +FEATURES_PROVIDED = transceiver periph_gpio periph_uart periph_spi periph_i2c periph_rtt diff --git a/boards/pca10000/Makefile.features b/boards/pca10000/Makefile.features index a326030628..3bae27ea31 100644 --- a/boards/pca10000/Makefile.features +++ b/boards/pca10000/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_random +FEATURES_PROVIDED = periph_gpio periph_random periph_rtt diff --git a/boards/pca10005/Makefile.features b/boards/pca10005/Makefile.features index a326030628..3bae27ea31 100644 --- a/boards/pca10005/Makefile.features +++ b/boards/pca10005/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_random +FEATURES_PROVIDED = periph_gpio periph_random periph_rtt diff --git a/boards/yunjia-nrf51822/Makefile.features b/boards/yunjia-nrf51822/Makefile.features index a326030628..3bae27ea31 100644 --- a/boards/yunjia-nrf51822/Makefile.features +++ b/boards/yunjia-nrf51822/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_random +FEATURES_PROVIDED = periph_gpio periph_random periph_rtt diff --git a/tests/periph_rtt/Makefile b/tests/periph_rtt/Makefile index a719175a62..869af1510c 100644 --- a/tests/periph_rtt/Makefile +++ b/tests/periph_rtt/Makefile @@ -1,9 +1,7 @@ export APPLICATION = periph_rtt include ../Makefile.tests_common -BOARD_BLACKLIST := chronos mbed_lpc1768 msb-430 msb-430h native qemu-i386 redbee-econotag telosb \ - wsn430-v1_3b wsn430-v1_4 z1 -# all listed boards: no periph_conf.h defined, +FEATURES_REQUIRED = periph_rtt DISABLE_MODULE += auto_init From b9d17e38f36b97cafb9989d908c9cac671565018 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:24:28 +0200 Subject: [PATCH 08/10] tests/periph_rtt: let build fail w/o RTT --- tests/periph_rtt/main.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/periph_rtt/main.c b/tests/periph_rtt/main.c index 8dcddadb5f..6d2788ccf3 100644 --- a/tests/periph_rtt/main.c +++ b/tests/periph_rtt/main.c @@ -28,9 +28,6 @@ #include "periph_conf.h" #include "periph/rtt.h" -/* only compile this test if a RTT device is defined */ -#if RTT_NUMOF - #define TICKS_TO_WAIT (10 * RTT_FREQUENCY) void cb(void *arg) @@ -59,15 +56,3 @@ int main(void) puts("Done setting up the RTT, wait for many Hellos"); return 0; } - -#else - -int main(void) -{ - puts("\nRIOT RTT low-level driver test"); - puts("There are no RTT devices defined for this board!"); - - return 0; -} - -#endif /* RTT_NUMOF */ From a20e287a96e3fa0f1b2e83c6b1d44823660ddf72 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:04:02 +0200 Subject: [PATCH 09/10] make: introduce and use periph_cpuid feature --- boards/cc2538dk/Makefile.features | 2 +- boards/native/Makefile.features | 2 +- boards/pca10000/Makefile.features | 2 +- boards/pca10005/Makefile.features | 2 +- boards/yunjia-nrf51822/Makefile.features | 2 +- tests/periph_cpuid/Makefile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boards/cc2538dk/Makefile.features b/boards/cc2538dk/Makefile.features index a326030628..42f40abd5f 100644 --- a/boards/cc2538dk/Makefile.features +++ b/boards/cc2538dk/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_random +FEATURES_PROVIDED = periph_gpio periph_random periph_cpuid diff --git a/boards/native/Makefile.features b/boards/native/Makefile.features index 762734b956..91747cc078 100644 --- a/boards/native/Makefile.features +++ b/boards/native/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = transceiver +FEATURES_PROVIDED = transceiver periph_cpuid diff --git a/boards/pca10000/Makefile.features b/boards/pca10000/Makefile.features index 3bae27ea31..c21f92a56a 100644 --- a/boards/pca10000/Makefile.features +++ b/boards/pca10000/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_random periph_rtt +FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid diff --git a/boards/pca10005/Makefile.features b/boards/pca10005/Makefile.features index 3bae27ea31..c21f92a56a 100644 --- a/boards/pca10005/Makefile.features +++ b/boards/pca10005/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_random periph_rtt +FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid diff --git a/boards/yunjia-nrf51822/Makefile.features b/boards/yunjia-nrf51822/Makefile.features index 3bae27ea31..c21f92a56a 100644 --- a/boards/yunjia-nrf51822/Makefile.features +++ b/boards/yunjia-nrf51822/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED = periph_gpio periph_random periph_rtt +FEATURES_PROVIDED = periph_gpio periph_random periph_rtt periph_cpuid diff --git a/tests/periph_cpuid/Makefile b/tests/periph_cpuid/Makefile index f85cbd9e8e..e078803205 100644 --- a/tests/periph_cpuid/Makefile +++ b/tests/periph_cpuid/Makefile @@ -1,6 +1,6 @@ export APPLICATION = periph_cpuid include ../Makefile.tests_common -#BOARD_WHITELIST := native +FEATURES_REQUIRED = periph_cpuid include $(RIOTBASE)/Makefile.include From 801928df4d556c2f1f2a6f8ac359c3ea9d56c981 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Thu, 16 Oct 2014 19:04:42 +0200 Subject: [PATCH 10/10] tests/periph_cpuid: let test fail w/o CPUID_ID_LEN --- tests/periph_cpuid/main.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tests/periph_cpuid/main.c b/tests/periph_cpuid/main.c index 3e80cac87b..7eedaca10b 100644 --- a/tests/periph_cpuid/main.c +++ b/tests/periph_cpuid/main.c @@ -25,9 +25,6 @@ #include "cpu-conf.h" #include "periph/cpuid.h" -/* only compile this test if CPUID getter is defined for the platform */ -#if CPUID_ID_LEN - int main(void) { uint8_t id[CPUID_ID_LEN]; @@ -47,14 +44,3 @@ int main(void) return 0; } - -#else - -int main(void) -{ - puts("Test for the CPUID driver"); - puts("Error: the CPUID driver is not defined for this platform"); - return 0; -} - -#endif /* CPUID_ID_LEN */