Checking if the rtc is running and starting it by setting the compile time and date if not the case
This commit is contained in:
parent
1affef42cf
commit
54e69e424a
@ -165,6 +165,15 @@ void user_main(void *param)
|
|||||||
u8 tmr_millis_id = tls_timer_create(&tmr_millis);
|
u8 tmr_millis_id = tls_timer_create(&tmr_millis);
|
||||||
tls_timer_start(tmr_millis_id);
|
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
|
//We create a task for the nano_shell process
|
||||||
u8 *nano_shell_task_stack = NULL, *nano_shell_server_task_stack = NULL;
|
u8 *nano_shell_task_stack = NULL, *nano_shell_server_task_stack = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user