From af9ef0d13488c6b3772c639cb4b045c651af806c Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Fri, 16 Aug 2013 17:36:18 +0800 Subject: optimize for 32KB program space --- obdlogger/obdlogger.ino | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'obdlogger/obdlogger.ino') diff --git a/obdlogger/obdlogger.ino b/obdlogger/obdlogger.ino index ac16184..7ed73cf 100644 --- a/obdlogger/obdlogger.ino +++ b/obdlogger/obdlogger.ino @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include "MicroLCD.h" @@ -70,6 +69,8 @@ LCD_SSD1306 lcd; #ifdef GPSUART +#include + #define PMTK_SET_NMEA_UPDATE_1HZ "$PMTK220,1000*1F" #define PMTK_SET_NMEA_UPDATE_5HZ "$PMTK220,200*2C" #define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F" @@ -131,16 +132,22 @@ public: if (state & STATE_ACC_READY) flags |= FLAG_ACC; uint16_t index = openFile(LOG_TYPE_DEFAULT, flags); lcd.setFont(FONT_SIZE_SMALL); - lcd.setFlags(FLAG_PAD_ZERO); lcd.setCursor(86, 0); - lcd.write('['); - lcd.printInt(index, 5); - lcd.write(']'); - lcd.setFlags(0); + if (index) { + lcd.write('['); + lcd.setFlags(FLAG_PAD_ZERO); + lcd.printInt(index, 5); + lcd.setFlags(0); + lcd.write(']'); + } else { + lcd.print("NO LOG"); + } delay(1000); +#ifndef MEMORY_SAVING showECUCap(); delay(3000); +#endif readSensor(PID_DISTANCE, startDistance); -- cgit v1.2.3