From 6268914b7c6eac2a8ee04b2f9d4c270fc5363dee Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 25 Nov 2018 13:56:44 +0000 Subject: RTC adjustments for F0 devices. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12439 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- testhal/STM32/multi/RTC/.cproject | 35 +++++++++++++++++++++++++++++++++++ testhal/STM32/multi/RTC/Makefile | 6 ++++++ testhal/STM32/multi/RTC/main.c | 6 ++++++ 3 files changed, 47 insertions(+) (limited to 'testhal') diff --git a/testhal/STM32/multi/RTC/.cproject b/testhal/STM32/multi/RTC/.cproject index 428122619..8125e9043 100644 --- a/testhal/STM32/multi/RTC/.cproject +++ b/testhal/STM32/multi/RTC/.cproject @@ -103,12 +103,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testhal/STM32/multi/RTC/Makefile b/testhal/STM32/multi/RTC/Makefile index 6266997ef..72e30918f 100644 --- a/testhal/STM32/multi/RTC/Makefile +++ b/testhal/STM32/multi/RTC/Makefile @@ -3,6 +3,10 @@ # all: + @echo + @echo === Building for STM32F0-Discovery =============================== + +@make --no-print-directory -f ./make/stm32f051_discovery.make all + @echo ==================================================================== @echo @echo === Building for STM32L476-Discovery =============================== +@make --no-print-directory -f ./make/stm32l476_discovery.make all @@ -14,6 +18,8 @@ all: @echo clean: + @echo + +@make --no-print-directory -f ./make/stm32f051_discovery.make clean @echo +@make --no-print-directory -f ./make/stm32l476_discovery.make clean @echo diff --git a/testhal/STM32/multi/RTC/main.c b/testhal/STM32/multi/RTC/main.c index f4dfb5334..6f9fdbe34 100644 --- a/testhal/STM32/multi/RTC/main.c +++ b/testhal/STM32/multi/RTC/main.c @@ -49,6 +49,7 @@ static void cmd_date(BaseSequentialStream *chp, int argc, char *argv[]) { timespec.year + 1980U); } +#if RTC_HAS_STORAGE static void cmd_storage(BaseSequentialStream *chp, int argc, char *argv[]) { size_t storage_size = psGetStorageSize(&RTCD1); ps_offset_t i; @@ -69,10 +70,13 @@ static void cmd_storage(BaseSequentialStream *chp, int argc, char *argv[]) { } } } +#endif static const ShellCommand commands[] = { {"date", cmd_date}, +#if RTC_HAS_STORAGE {"storage", cmd_storage}, +#endif {NULL, NULL} }; @@ -162,7 +166,9 @@ int main(void) { rtcSetAlarm(&RTCD1, 0, &alarm1); rtcSetAlarm(&RTCD1, 1, &alarm2); rtcSetCallback(&RTCD1, alarmcb); +#if RTC_HAS_STORAGE psWrite(&RTCD1, 0U, 12U, (const uint8_t *)"Hello World!"); +#endif /* Normal main() thread activity, spawning shells.*/ while (true) { -- cgit v1.2.3