diff --git a/firmware/console/binary/serial_can.cpp b/firmware/console/binary/serial_can.cpp index d248f4ae51..7ace7c632d 100644 --- a/firmware/console/binary/serial_can.cpp +++ b/firmware/console/binary/serial_can.cpp @@ -76,6 +76,7 @@ int CanStreamerState::sendFrame(const IsoTpFrameHeader & header, const uint8_t * int CanStreamerState::receiveFrame(CANRxFrame *rxmsg, uint8_t *buf, int num, can_sysinterval_t timeout) { if (rxmsg == nullptr || rxmsg->DLC < 1) return 0; + engine->pauseCANdueToSerial = true; int frameType = (rxmsg->data8[0] >> 4) & 0xf; int numBytesAvailable, frameIdx; uint8_t *srcBuf = rxmsg->data8; diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 0cd591cbff..d2e4770c7c 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -120,6 +120,11 @@ public: bool isPwmEnabled = true; const char *prevOutputName = nullptr; + /** + * ELM327 cannot handle both RX and TX at the same time, we have to stay quite once first ISO/TP packet was detected + * this is a pretty temporary hack only while we are trying ELM327, long term ISO/TP and rusEFI broadcast should find a way to coexists + */ + bool pauseCANdueToSerial = false; PinRepository pinRepository; diff --git a/firmware/controllers/can/can_tx.cpp b/firmware/controllers/can/can_tx.cpp index 071d491a0f..c967d853db 100644 --- a/firmware/controllers/can/can_tx.cpp +++ b/firmware/controllers/can/can_tx.cpp @@ -31,7 +31,7 @@ void CanWrite::PeriodicTask(efitime_t nowNt) { CanCycle cycle(cycleCount); //in case we have Verbose Can enabled, we should keep user configured period - if (engineConfiguration->enableVerboseCanTx) { + if (engineConfiguration->enableVerboseCanTx && !engine->pauseCANdueToSerial) { uint16_t cycleCountsPeriodMs = cycleCount * CAN_CYCLE_PERIOD; if (0 != engineConfiguration->canSleepPeriodMs) { if (cycleCountsPeriodMs % engineConfiguration->canSleepPeriodMs) {