diff options
| author | Maximilien Cuony <maximilien@theglu.org> | 2016-06-03 21:44:56 +0200 |
|---|---|---|
| committer | Maximilien Cuony <maximilien@theglu.org> | 2016-06-03 21:44:56 +0200 |
| commit | 53c2afbf719d91f660e815c160e73066ef1ec9e0 (patch) | |
| tree | 154a09643c55152360b5ad7d4ed7c7f0e45d0397 /src/common | |
| parent | 64e3e0b76ebebe2cea949e27d49c149b2e876391 (diff) | |
| download | glutte-o-matic-53c2afbf719d91f660e815c160e73066ef1ec9e0.tar.gz glutte-o-matic-53c2afbf719d91f660e815c160e73066ef1ec9e0.tar.bz2 glutte-o-matic-53c2afbf719d91f660e815c160e73066ef1ec9e0.zip | |
Working GPS simulator
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/src/Core/common.c | 2 | ||||
| -rw-r--r-- | src/common/src/Core/main.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/common/src/Core/common.c b/src/common/src/Core/common.c index 4adca26..c31bbf8 100644 --- a/src/common/src/Core/common.c +++ b/src/common/src/Core/common.c @@ -128,7 +128,9 @@ int local_time(struct tm *time) time->tm_isdst = 1; } +#ifdef SIMULATOR time->tm_year -= 1900; //TODO Same on hardware ? +#endif // Let mktime fix the struct tm *time if (mktime(time) == (time_t)-1) { diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c index 4eebfa2..1a72e32 100644 --- a/src/common/src/Core/main.c +++ b/src/common/src/Core/main.c @@ -126,12 +126,6 @@ static void test_task(void *pvParameters) { leds_turn_off(LED_RED); } - char * poney = "$GNRMC,202140.00,A,4719.59789,N,00830.92084,E,0.012,,310516,,,A*65\n"; - gps_usart_send(poney); - /* char * poney2 = "$GNRMC,202141.00,A,4719.59788,N,00830.92085,E,0.012,,310516,,,A*64"; */ - /* gps_usart_send(poney2); */ - /* char * poney3 = "$GNRMC,202142.00,A,4719.59785,N,00830.92087,E,0.010,,310516,,,A*6A"; */ - /* gps_usart_send(poney3); */ } } @@ -339,7 +333,12 @@ static void gps_monit_task(void *pvParameters) { gps_time.tm_hour, gps_time.tm_min, gps_time.tm_sec); usart_debug("TIME %04d-%02d-%02d %02d:%02d:%02d\r\n", - time.tm_year, time.tm_mon, time.tm_mday, +#ifdef SIMULATOR + time.tm_year + 1900, +#else + time.tm_year, +#endif + time.tm_mon, time.tm_mday, time.tm_hour, time.tm_min, time.tm_sec); t_gps_print_latch = 1; |
