diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/src/Core/main.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c index 75a444a..125671f 100644 --- a/src/common/src/Core/main.c +++ b/src/common/src/Core/main.c @@ -305,6 +305,9 @@ static void gps_monit_task(void __attribute__ ((unused))*pvParameters) { leds_turn_on(LED_BLUE); int t_gps_print_latch = 0; + int t_gps_hours_handeled = 0; + uint64_t last_hour_timestamp = 0; + while (1) { struct tm time; @@ -345,6 +348,30 @@ static void gps_monit_task(void __attribute__ ((unused))*pvParameters) { t_gps_print_latch = 0; } + if (time_valid && gps_time.tm_sec == 0 && gps_time.tm_min == 0 && t_gps_hours_handeled == 0) { + + uint64_t current_timestamp = timestamp_now(); + + if (last_hour_timestamp == 0) { + usart_debug("DERIV INIT TS=%i\r\n", current_timestamp); + } else { + + usart_debug("DERIV TS=%lld Excepted=%lld Delta=%lld\r\n", + current_timestamp, + last_hour_timestamp + 3600000, + last_hour_timestamp + 3600000 - current_timestamp + ); + } + + last_hour_timestamp = timestamp_now(); + + t_gps_hours_handeled = 1; + } + + if (gps_time.tm_sec != 0) { + t_gps_hours_handeled = 0; + } + vTaskDelay(100 / portTICK_RATE_MS); // Reload watchdog |