From 75b3ade0cf5664ce0c50b01dfe4a68d93ee5e3d5 Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Tue, 25 Mar 2014 22:31:19 +0800 Subject: Update UNO Logger --- unologger/unologger.ino | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'unologger') 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++; -- cgit v1.2.3