summaryrefslogtreecommitdiff
path: root/libraries/OBD
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2013-06-29 11:53:55 +0800
committerStanley Huang <stanleyhuangyc@gmail.com>2013-06-29 11:53:55 +0800
commit6884a5731ae4bbae7a3457b332e00174e5abe080 (patch)
tree729f99ceb1939ee3924ef95d38edf9e89070e114 /libraries/OBD
parent17abc0d3cf9b226b06e5d62790a8d5e576846571 (diff)
download2021-arduino-obd-6884a5731ae4bbae7a3457b332e00174e5abe080.tar.gz
2021-arduino-obd-6884a5731ae4bbae7a3457b332e00174e5abe080.tar.bz2
2021-arduino-obd-6884a5731ae4bbae7a3457b332e00174e5abe080.zip
fix serial UART initialization bug
Diffstat (limited to 'libraries/OBD')
-rw-r--r--libraries/OBD/OBD.cpp4
-rw-r--r--libraries/OBD/OBD.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/libraries/OBD/OBD.cpp b/libraries/OBD/OBD.cpp
index 5a78de9..38fbf01 100644
--- a/libraries/OBD/OBD.cpp
+++ b/libraries/OBD/OBD.cpp
@@ -227,9 +227,9 @@ bool COBD::isValidPID(byte pid)
return pidmap[i] & b;
}
-void COBD::begin(int baudrate)
+void COBD::begin()
{
- OBDUART.begin(baudrate);
+ OBDUART.begin(OBD_SERIAL_BAUDRATE);
}
bool COBD::init(bool passive)
diff --git a/libraries/OBD/OBD.h b/libraries/OBD/OBD.h
index 144d0a9..28cc19d 100644
--- a/libraries/OBD/OBD.h
+++ b/libraries/OBD/OBD.h
@@ -43,8 +43,8 @@ unsigned char hex2uint8(const char *p);
class COBD
{
public:
- COBD():dataMode(1),errors(0) {}
- void begin(int baudrate = OBD_SERIAL_BAUDRATE);
+ COBD():dataMode(1),errors(0) {}
+ void begin();
bool init(bool passive = false);
bool readSensor(byte pid, int& result, bool passive = false);
bool isValidPID(byte pid);