From 64e3e0b76ebebe2cea949e27d49c149b2e876391 Mon Sep 17 00:00:00 2001 From: Maximilien Cuony Date: Fri, 3 Jun 2016 09:29:22 +0200 Subject: Travail de train GPS --- src/common/src/Core/common.c | 3 +++ src/common/src/Core/main.c | 1 - src/common/src/GPS/gps.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/common') diff --git a/src/common/src/Core/common.c b/src/common/src/Core/common.c index 8c63917..4adca26 100644 --- a/src/common/src/Core/common.c +++ b/src/common/src/Core/common.c @@ -128,11 +128,14 @@ int local_time(struct tm *time) time->tm_isdst = 1; } + time->tm_year -= 1900; //TODO Same on hardware ? + // Let mktime fix the struct tm *time if (mktime(time) == (time_t)-1) { // TODO inform about failure valid = 0; } + } return valid; diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c index feac593..4eebfa2 100644 --- a/src/common/src/Core/main.c +++ b/src/common/src/Core/main.c @@ -320,7 +320,6 @@ static void gps_monit_task(void *pvParameters) { int time_valid = local_time(&time); if (time_valid) { - printf("Valid\n"); if (time.tm_sec % 4 >= 2) { leds_turn_on(LED_BLUE); } diff --git a/src/common/src/GPS/gps.c b/src/common/src/GPS/gps.c index 61c8c48..568a181 100644 --- a/src/common/src/GPS/gps.c +++ b/src/common/src/GPS/gps.c @@ -56,6 +56,7 @@ int gps_utctime(struct tm *timeutc) { timeutc->tm_sec = gps_timeutc.tm_sec; valid = gps_timeutc_valid; } + xSemaphoreGive(timeutc_semaphore); return valid; -- cgit v1.2.3