summaryrefslogtreecommitdiff
path: root/megalogger/megalogger.ino
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2015-09-22 19:17:39 +1000
committerStanley Huang <stanleyhuangyc@gmail.com>2015-09-22 19:17:39 +1000
commit039be5bd99ac673530be5eaae176c230956853ca (patch)
treeeef14dbbea6d1989f225d33bf85935a68bd91c45 /megalogger/megalogger.ino
parentbec088626c5897d89c3f06d844f1618261604b3c (diff)
download2021-arduino-obd-039be5bd99ac673530be5eaae176c230956853ca.tar.gz
2021-arduino-obd-039be5bd99ac673530be5eaae176c230956853ca.tar.bz2
2021-arduino-obd-039be5bd99ac673530be5eaae176c230956853ca.zip
Revert "Fix GPS date logging bug"
This reverts commit bec088626c5897d89c3f06d844f1618261604b3c.
Diffstat (limited to 'megalogger/megalogger.ino')
-rw-r--r--megalogger/megalogger.ino16
1 files changed, 8 insertions, 8 deletions
diff --git a/megalogger/megalogger.ino b/megalogger/megalogger.ino
index 4d76f3d..629450f 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 byte gpsDate = 0;
+static uint16_t 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 != (byte)gpsDate) {
+ if (date != gpsDate) {
// log date only if it's changed
- logger.logData(PID_GPS_DATE, (int32_t)date);
- gpsDate = (byte)date;
+ logger.logData(PID_GPS_DATE, (int32_t)time);
+ gpsDate = 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
- do {
- testOut();
- // initialize the OBD until success
- } while (!obd.init(OBD_PROTOCOL));
+ testOut();
+
+ // initialize the OBD until success
+ while (!obd.init(OBD_PROTOCOL));
state |= STATE_OBD_READY;