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/main.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testhal/STM32/multi/RTC/main.c') 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