diff options
author | Maximilien Cuony <maximilien@theglu.org> | 2016-06-06 19:05:23 +0200 |
---|---|---|
committer | Maximilien Cuony <maximilien@theglu.org> | 2016-06-06 19:05:23 +0200 |
commit | 4e90199ff450df4e3b7226b3ed1a3b95448f3033 (patch) | |
tree | b2ed688ab6c4080a741f39bc266d9d103e985c4c /src | |
parent | e2e1af13be32fe00f98135beb62617ea0bba7bc8 (diff) | |
download | glutte-o-matic-4e90199ff450df4e3b7226b3ed1a3b95448f3033.tar.gz glutte-o-matic-4e90199ff450df4e3b7226b3ed1a3b95448f3033.tar.bz2 glutte-o-matic-4e90199ff450df4e3b7226b3ed1a3b95448f3033.zip |
Internal ts test
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 |