summaryrefslogtreecommitdiff
path: root/unologger
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2014-03-25 22:31:19 +0800
committerStanley Huang <stanleyhuangyc@gmail.com>2014-03-25 22:31:19 +0800
commit75b3ade0cf5664ce0c50b01dfe4a68d93ee5e3d5 (patch)
treec61ced48cc1a80b295f1d21b2f76bd2bd9d93026 /unologger
parent85a1b01b2d91a41bb54afc695f529003fd093bd7 (diff)
download2021-arduino-obd-75b3ade0cf5664ce0c50b01dfe4a68d93ee5e3d5.tar.gz
2021-arduino-obd-75b3ade0cf5664ce0c50b01dfe4a68d93ee5e3d5.tar.bz2
2021-arduino-obd-75b3ade0cf5664ce0c50b01dfe4a68d93ee5e3d5.zip
Update UNO Logger
Diffstat (limited to 'unologger')
-rw-r--r--unologger/unologger.ino11
1 files changed, 8 insertions, 3 deletions
diff --git a/unologger/unologger.ino b/unologger/unologger.ino
index 9c03ac6..53a08cb 100644
--- a/unologger/unologger.ino
+++ b/unologger/unologger.ino
@@ -245,8 +245,8 @@ private:
}
#if ENABLE_DATA_LOG
- // flush SD data every 1KB
- if (dataSize - lastFileSize >= 1024) {
+ // flush SD data every 4KB
+ if (dataSize - lastFileSize >= 4096) {
flushFile();
lastFileSize = dataSize;
// display logged data size
@@ -320,11 +320,16 @@ private:
state &= ~(STATE_OBD_READY | STATE_ACC_READY);
state |= STATE_SLEEPING;
//digitalWrite(SD_CS_PIN, LOW);
- for (uint16_t i = 0; !init(); i++) {
+ for (uint16_t i = 0; ; i++) {
if (i == 5) {
lcd.backlight(false);
lcd.clear();
}
+ if (init()) {
+ int value;
+ if (read(PID_RPM, value) && value > 0)
+ break;
+ }
}
state &= ~STATE_SLEEPING;
fileIndex++;