From 54e69e424a61acca4e22e9d6b194fcad5084f649 Mon Sep 17 00:00:00 2001 From: Anatole SCHRAMM Date: Thu, 31 Jul 2025 16:11:07 +0200 Subject: [PATCH] Checking if the rtc is running and starting it by setting the compile time and date if not the case --- app/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/main.c b/app/main.c index 4ff4a34..4d7d7d5 100644 --- a/app/main.c +++ b/app/main.c @@ -165,6 +165,15 @@ void user_main(void *param) u8 tmr_millis_id = tls_timer_create(&tmr_millis); tls_timer_start(tmr_millis_id); + //Let's start the RTC if not already running + if(!tls_is_rtc_running()) + { + shell_printf("Starting RTC"NEW_LINE); + struct tm curr_time; + time_date_to_tm(__TIME__" "__DATE__, &curr_time); + tls_set_rtc(&curr_time); + } + //We create a task for the nano_shell process u8 *nano_shell_task_stack = NULL, *nano_shell_server_task_stack = NULL;