diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-05-11 11:53:09 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-05-11 11:53:09 +0800 |
commit | 65a30f4d5e52c5de00428dad549add2410e72f84 (patch) | |
tree | 031b27f6e7f1fae6dadda69fe1192a68dc0e2bb0 /obdlogger | |
parent | bf4f5ca574f5d4f5c561895af0e5ab40f3cc8063 (diff) | |
download | 2021-arduino-obd-65a30f4d5e52c5de00428dad549add2410e72f84.tar.gz 2021-arduino-obd-65a30f4d5e52c5de00428dad549add2410e72f84.tar.bz2 2021-arduino-obd-65a30f4d5e52c5de00428dad549add2410e72f84.zip |
reformatting library source code
Diffstat (limited to 'obdlogger')
-rw-r--r-- | obdlogger/OBD.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/obdlogger/OBD.cpp b/obdlogger/OBD.cpp index 609e5dd..55f31e6 100644 --- a/obdlogger/OBD.cpp +++ b/obdlogger/OBD.cpp @@ -69,20 +69,20 @@ void COBD::Query(unsigned char pid) bool COBD::ReadSensor(byte pid, int& result, bool passive) { - // send a query command - Query(pid); - // wait for reponse - bool hasData; - unsigned long tick = millis(); - do { - DataIdleLoop(); - } while (!(hasData = available()) && millis() - tick < OBD_TIMEOUT_SHORT); - if (!hasData) { - errors++; - return false; - } - // receive and parse the response - return GetResponseParsed(pid, result); + // send a query command + Query(pid); + // wait for reponse + bool hasData; + unsigned long tick = millis(); + do { + DataIdleLoop(); + } while (!(hasData = available()) && millis() - tick < OBD_TIMEOUT_SHORT); + if (!hasData) { + errors++; + return false; + } + // receive and parse the response + return GetResponseParsed(pid, result); } bool COBD::available() |