From 1cbeec17ceb8e55be4032a69d9d745b885f4771d Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Thu, 24 Sep 2015 11:56:04 +1000 Subject: Minor update --- megalogger/datalogger.h | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'megalogger/datalogger.h') diff --git a/megalogger/datalogger.h b/megalogger/datalogger.h index 45b1cb7..d59819e 100644 --- a/megalogger/datalogger.h +++ b/megalogger/datalogger.h @@ -6,8 +6,7 @@ *************************************************************************/ #define FORMAT_BIN 0 -#define FORMAT_CSV 1 -#define FORMAT_TEXT 2 +#define FORMAT_TEXT 1 typedef struct { uint32_t time; @@ -40,6 +39,8 @@ typedef struct { #if USE_SOFTSERIAL SoftwareSerial SerialRF(A2, A3); +#elif defined(RF_SERIAL) +#define SerialRF RF_SERIAL #else #define SerialRF Serial #endif @@ -77,13 +78,8 @@ public: { #if ENABLE_DATA_OUT SerialRF.begin(STREAM_BAUDRATE); - /* SerialRF.print("AT+NAMEFreematics"); delay(10); - while (SerialRF.available()) SerialRF.read(); - SerialRF.println(); - */ - m_lastSendTime = 0; #endif #if ENABLE_DATA_LOG m_lastDataTime = 0; @@ -101,12 +97,7 @@ public: void sendData(const char* buf, byte len) { SerialRF.write(buf, len); -#if MIN_DATA_INTERVAL - uint32_t t = millis(); - uint32_t elapsed = t - m_lastSendTime; - if (elapsed < MIN_DATA_INTERVAL) delay(MIN_DATA_INTERVAL - elapsed); - m_lastSendTime = t; -#endif + delay(10); } void logData(char c) { @@ -247,7 +238,4 @@ private: #if ENABLE_DATA_LOG uint32_t m_lastDataTime; #endif -#if ENABLE_DATA_OUT - uint32_t m_lastSendTime; -#endif }; -- cgit v1.2.3