aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/multi/RTC/main.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-11-25 13:56:44 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-11-25 13:56:44 +0000
commit6268914b7c6eac2a8ee04b2f9d4c270fc5363dee (patch)
tree49eb94045477dd3d2794afee365adfb21dcee5f0 /testhal/STM32/multi/RTC/main.c
parentb8a4c26a9cab50e5a845d0033665a4d74b17444b (diff)
downloadChibiOS-6268914b7c6eac2a8ee04b2f9d4c270fc5363dee.tar.gz
ChibiOS-6268914b7c6eac2a8ee04b2f9d4c270fc5363dee.tar.bz2
ChibiOS-6268914b7c6eac2a8ee04b2f9d4c270fc5363dee.zip
RTC adjustments for F0 devices.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12439 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'testhal/STM32/multi/RTC/main.c')
-rw-r--r--testhal/STM32/multi/RTC/main.c6
1 files changed, 6 insertions, 0 deletions
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) {