This commit is contained in:
Ján Mátik
2020-12-23 12:09:37 +01:00
13 changed files with 202 additions and 219 deletions

View File

@@ -48,6 +48,7 @@ void CommObd2Can::connectDevice() {
pinMode(pinCanInt, INPUT); // Configuring pin for /INT input
// Serve first command (ATZ)
liveData->commConnected = true;
doNextQueueCommand();
Serial.println("init_can() done");
@@ -58,6 +59,7 @@ void CommObd2Can::connectDevice() {
*/
void CommObd2Can::disconnectDevice() {
liveData->commConnected = false;
Serial.println("COMM disconnectDevice");
}
@@ -88,7 +90,7 @@ void CommObd2Can::mainLoop() {
delay(1);
// apply timeout for next frames loop too
if (lastDataSent != 0 && (unsigned long)(millis() - lastDataSent) > 100) {
Serial.print("CAN execution timeout (multiframe message).");
Serial.print("CAN execution timeout (multiframe message).\n");
break;
}
}
@@ -99,7 +101,7 @@ void CommObd2Can::mainLoop() {
}
}
if (lastDataSent != 0 && (unsigned long)(millis() - lastDataSent) > 100) {
Serial.print("CAN execution timeout. Continue with next command.");
Serial.print("CAN execution timeout. Continue with next command.\n");
liveData->canSendNextAtCommand = true;
return;
}