summaryrefslogtreecommitdiff
path: root/megalogger
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2015-10-08 13:03:39 +1100
committerStanley Huang <stanleyhuangyc@gmail.com>2015-10-08 13:03:39 +1100
commitf2cbbc15143b4192961740fdf342c8d4cfde85d1 (patch)
tree868c0722587e3dad532249547040fab3eef51e26 /megalogger
parenta979a3a2c41ef3fe19ec154616460c755ed04a10 (diff)
download2021-arduino-obd-f2cbbc15143b4192961740fdf342c8d4cfde85d1.tar.gz
2021-arduino-obd-f2cbbc15143b4192961740fdf342c8d4cfde85d1.tar.bz2
2021-arduino-obd-f2cbbc15143b4192961740fdf342c8d4cfde85d1.zip
Fix compilation issue when GPS is disabled
Diffstat (limited to 'megalogger')
-rw-r--r--megalogger/datalogger.h2
-rw-r--r--megalogger/megalogger.ino10
2 files changed, 10 insertions, 2 deletions
diff --git a/megalogger/datalogger.h b/megalogger/datalogger.h
index d59819e..e6f0709 100644
--- a/megalogger/datalogger.h
+++ b/megalogger/datalogger.h
@@ -96,8 +96,10 @@ public:
}
void sendData(const char* buf, byte len)
{
+#if ENABLE_DATA_OUT
SerialRF.write(buf, len);
delay(10);
+#endif
}
void logData(char c)
{
diff --git a/megalogger/megalogger.ino b/megalogger/megalogger.ino
index 03cc2a9..a228a4e 100644
--- a/megalogger/megalogger.ino
+++ b/megalogger/megalogger.ino
@@ -49,16 +49,18 @@ static uint32_t lastMemsDataTime = 0;
#endif
static uint8_t lastFileSize = 0;
-static uint32_t lastGPSDataTime = 0;
static uint32_t lastRefreshTime = 0;
static uint32_t distance = 0;
static uint32_t startTime = 0;
static uint16_t lastSpeed = 0;
static uint32_t lastSpeedTime = 0;
-static int gpsSpeed = -1;
static uint32_t gpsDate = 0;
static uint32_t obdTime = 0;
static uint8_t obdCount = 0;
+#if USE_GPS
+static uint32_t lastGPSDataTime = 0;
+static int gpsSpeed = -1;
+#endif
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};
@@ -153,6 +155,7 @@ void showPIDData(byte pid, int value)
setColorByValue(value, 60, 100, 160);
lcd.printInt(value, 3);
+#if USE_GPS
if (gpsSpeed != -1) {
lcd.setFontSize(FONT_SIZE_SMALL);
lcd.setCursor(110, 2);
@@ -167,6 +170,7 @@ void showPIDData(byte pid, int value)
}
lcd.write(' ');
}
+#endif
}
break;
case PID_ENGINE_LOAD:
@@ -666,6 +670,7 @@ void showStates()
lcd.setColor((state & STATE_MEMS_READY) ? RGB16_GREEN : RGB16_RED);
lcd.draw((state & STATE_MEMS_READY) ? tick : cross, 16, 16);
+#if USE_GPS
lcd.setColor(RGB16_WHITE);
lcd.setCursor(60, 8);
lcd.print(" GPS ");
@@ -676,6 +681,7 @@ void showStates()
lcd.setColor(RGB16_RED);
lcd.draw(cross, 16, 16);
}
+#endif
lcd.setColor(RGB16_WHITE);
}