summaryrefslogtreecommitdiff
path: root/libraries/OBD/OBD.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/OBD/OBD.cpp')
-rw-r--r--libraries/OBD/OBD.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libraries/OBD/OBD.cpp b/libraries/OBD/OBD.cpp
index bf778bf..72955f0 100644
--- a/libraries/OBD/OBD.cpp
+++ b/libraries/OBD/OBD.cpp
@@ -378,8 +378,9 @@ void COBD::end()
bool COBD::setBaudRate(unsigned long baudrate)
{
char buf[OBD_RECV_BUF_SIZE];
- sprintf(buf, "ATBR2 %lu\r", baudrate);
- OBDUART.print(buf);
+ OBDUART.print("ATBR1 ");
+ OBDUART.print(baudrate);
+ OBDUART.print('\r');
if (receive(buf) && strstr(buf, "OK")) {
OBDUART.end();
OBDUART.begin(baudrate);
@@ -503,6 +504,7 @@ byte COBDI2C::receive(char* buffer, int timeout)
{
uint32_t start = millis();
byte offset = 0;
+ delay(10);
do {
Wire.requestFrom((byte)I2C_ADDR, (byte)MAX_PAYLOAD_SIZE, (byte)1);