diff --git a/tests/cpuid/Makefile b/tests/periph_cpuid/Makefile similarity index 54% rename from tests/cpuid/Makefile rename to tests/periph_cpuid/Makefile index 8486432c02..f85cbd9e8e 100644 --- a/tests/cpuid/Makefile +++ b/tests/periph_cpuid/Makefile @@ -1,6 +1,6 @@ -export APPLICATION = cpu_id +export APPLICATION = periph_cpuid include ../Makefile.tests_common -BOARD_WHITELIST := native +#BOARD_WHITELIST := native include $(RIOTBASE)/Makefile.include diff --git a/tests/cpuid/main.c b/tests/periph_cpuid/main.c similarity index 54% rename from tests/cpuid/main.c rename to tests/periph_cpuid/main.c index f33a3022ba..3e80cac87b 100644 --- a/tests/cpuid/main.c +++ b/tests/periph_cpuid/main.c @@ -14,6 +14,7 @@ * @brief GET_CPU_ID() test application * * @author Martin Lenders + * @author Hauke Petersen * * @} */ @@ -24,21 +25,36 @@ #include "cpu-conf.h" #include "periph/cpuid.h" -#ifndef CPUID_ID_LEN -#error "cpuid is not defined for the CPU type of this board" -#endif +/* 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]; + puts("Test for the CPUID driver"); + puts("This test is reading out the CPUID of the platforms CPU\n"); + + /* read the CPUID */ cpuid_get(id); + /* print the CPUID */ + printf("CPUID:"); for (unsigned int i = 0; i < CPUID_ID_LEN; i++) { - printf("0x%02x ", id[i]); + printf(" 0x%02x", id[i]); } - printf("\n"); 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 */