mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Added a TX error for CAN comms
This commit is contained in:
parent
091334789a
commit
09db1513f1
12 changed files with 33 additions and 22 deletions
|
@ -13,10 +13,10 @@ int ESP32CAN::CANWriteFrame(const CAN_frame_t* p_frame) {
|
|||
tx_ok = (result == 0) ? true : false;
|
||||
if (tx_ok == false) {
|
||||
Serial.println("CAN failure! Check wires");
|
||||
set_event(EVENT_CAN_FAILURE, 0);
|
||||
set_event(EVENT_CAN_TX_FAILURE, 0);
|
||||
start_time = millis();
|
||||
} else {
|
||||
clear_event(EVENT_CAN_FAILURE);
|
||||
clear_event(EVENT_CAN_TX_FAILURE);
|
||||
}
|
||||
} else {
|
||||
if ((millis() - start_time) >= 2000) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue