From b2eea06bf62a3216175f8037319529aea95ce3eb Mon Sep 17 00:00:00 2001 From: Lubos Petrovic Date: Mon, 21 Dec 2020 08:12:45 +0100 Subject: [PATCH] fix --- CommObd2Can.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CommObd2Can.cpp b/CommObd2Can.cpp index 6ecb95c..928c136 100644 --- a/CommObd2Can.cpp +++ b/CommObd2Can.cpp @@ -77,7 +77,7 @@ void CommObd2Can::mainLoop() { delay(10); } } - if (liveData->params.currentTime + 500 > lastDataSent) { + if (lastDataSent != 0 || liveData->params.currentTime + 500 > lastDataSent) { Serial.print("CAN execution timeout. Continue with next command."); liveData->canSendNextAtCommand = true; return; @@ -91,9 +91,9 @@ void CommObd2Can::executeCommand(String cmd) { Serial.print("executeCommand "); Serial.println(cmd); + lastDataSent = 0; - - if (cmd == "" || cmd.startsWith("AT")) { // skip AT commands as not used by direct CAN connection + if (cmd.equals("") || cmd.startsWith("AT")) { // skip AT commands as not used by direct CAN connection liveData->canSendNextAtCommand = true; return; }