diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-08-16 00:57:43 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-08-16 00:57:43 +0800 |
commit | 6cb3c04fa37588eddf1341d77d1d70cfd8a2fcb3 (patch) | |
tree | 945437f3e635019e69d4de2d0384dc2945346c2c | |
parent | fccdb6d83fe265bc99c94afbf9fd3a284647595b (diff) | |
download | 2021-arduino-obd-6cb3c04fa37588eddf1341d77d1d70cfd8a2fcb3.tar.gz 2021-arduino-obd-6cb3c04fa37588eddf1341d77d1d70cfd8a2fcb3.tar.bz2 2021-arduino-obd-6cb3c04fa37588eddf1341d77d1d70cfd8a2fcb3.zip |
compiled code can now fit into 32KB
-rw-r--r-- | obdlogger/MultiLCD.h | 4 | ||||
-rw-r--r-- | obdlogger/obdlogger.cbp | 8 | ||||
-rw-r--r-- | obdlogger/obdlogger.ino | 6 |
3 files changed, 14 insertions, 4 deletions
diff --git a/obdlogger/MultiLCD.h b/obdlogger/MultiLCD.h index f7b703b..1206414 100644 --- a/obdlogger/MultiLCD.h +++ b/obdlogger/MultiLCD.h @@ -5,6 +5,10 @@ * All rights reserved. *************************************************************************/ +#if !defined(__AVR_ATmega2560__) && !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega644P__) +#define MEMORY_SAVING +#endif + typedef enum { FONT_SIZE_SMALL = 0, FONT_SIZE_MEDIUM, diff --git a/obdlogger/obdlogger.cbp b/obdlogger/obdlogger.cbp index f24add3..b2ca76b 100644 --- a/obdlogger/obdlogger.cbp +++ b/obdlogger/obdlogger.cbp @@ -33,11 +33,12 @@ <Option type="1" /> <Option compiler="avrgcc" /> <Compiler> + <Add option="-Os" /> <Add option="-x c++" /> <Add option="-mmcu=$(MCU)" /> <Add option="-DF_CPU=16000000L" /> <Add option="-D__AVR_ATmega328P__" /> - <Add option="-Os" /> + <Add option="-DMEMORY_SAVING" /> <Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" /> <Add directory="$(ARDUINO_DIR)/libraries" /> <Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" /> @@ -582,7 +583,12 @@ <Compiler> <Add directory="." /> </Compiler> + <Unit filename="MultiLCD.cpp" /> + <Unit filename="MultiLCD.h" /> + <Unit filename="SSD1306.cpp" /> + <Unit filename="SSD1306.h" /> <Unit filename="datalogger.h" /> + <Unit filename="fonts.cpp" /> <Unit filename="images.h" /> <Unit filename="obdlogger.ino"> <Option compile="1" /> diff --git a/obdlogger/obdlogger.ino b/obdlogger/obdlogger.ino index 7aaa79d..12eb7bf 100644 --- a/obdlogger/obdlogger.ino +++ b/obdlogger/obdlogger.ino @@ -9,20 +9,20 @@ #include <Wire.h> #include <OBD.h> #include <SD.h> -#include <MultiLCD.h> #include <TinyGPS.h> #include <MPU6050.h> #include <SoftwareSerial.h> +#include "MultiLCD.h" #include "images.h" #include "datalogger.h" /************************************** * Choose SD pin here **************************************/ +//#define SD_CS_PIN SS // generic //#define SD_CS_PIN 4 // ethernet shield //#define SD_CS_PIN 7 // microduino -//#define SD_CS_PIN 10 // SD breakout -#define SD_CS_PIN SS +#define SD_CS_PIN 10 // SD breakout /************************************** * Config GPS here |