From 65a30f4d5e52c5de00428dad549add2410e72f84 Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Sat, 11 May 2013 11:53:09 +0800 Subject: reformatting library source code --- obdlogger/OBD.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'obdlogger') 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() -- cgit v1.2.3