diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2015-09-22 18:45:03 +1000 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2015-09-22 18:45:03 +1000 |
commit | bec088626c5897d89c3f06d844f1618261604b3c (patch) | |
tree | 60750ab041af7508646afd4b49cd34933ab211c2 | |
parent | 6eeb9120c5dd32b5d515a656421db4b405639447 (diff) | |
download | 2021-arduino-obd-bec088626c5897d89c3f06d844f1618261604b3c.tar.gz 2021-arduino-obd-bec088626c5897d89c3f06d844f1618261604b3c.tar.bz2 2021-arduino-obd-bec088626c5897d89c3f06d844f1618261604b3c.zip |
Fix GPS date logging bug
-rw-r--r-- | megalogger/megalogger.ino | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/megalogger/megalogger.ino b/megalogger/megalogger.ino index 629450f..4d76f3d 100644 --- a/megalogger/megalogger.ino +++ b/megalogger/megalogger.ino @@ -56,7 +56,7 @@ static uint32_t startTime = 0; static uint16_t lastSpeed = 0; static uint32_t lastSpeedTime = 0; static int gpsSpeed = -1; -static uint16_t gpsDate = 0; +static byte gpsDate = 0; static const byte PROGMEM pidTier1[]= {PID_RPM, PID_SPEED, PID_ENGINE_LOAD, PID_THROTTLE}; static const byte PROGMEM pidTier2[] = {PID_INTAKE_MAP, PID_MAF_FLOW, PID_TIMING_ADVANCE}; @@ -376,10 +376,10 @@ void processGPS() logger.dataTime = millis(); gps.get_datetime(&date, &time, 0); - if (date != gpsDate) { + if (date != (byte)gpsDate) { // log date only if it's changed - logger.logData(PID_GPS_DATE, (int32_t)time); - gpsDate = date; + logger.logData(PID_GPS_DATE, (int32_t)date); + gpsDate = (byte)date; } logger.logData(PID_GPS_TIME, (int32_t)time); @@ -757,10 +757,10 @@ void setup() obd.begin(); // this will send a bunch of commands and display response - testOut(); - - // initialize the OBD until success - while (!obd.init(OBD_PROTOCOL)); + do { + testOut(); + // initialize the OBD until success + } while (!obd.init(OBD_PROTOCOL)); state |= STATE_OBD_READY; |