From 37961639d1a1c0306a4bd704be4e5a75b22a4d15 Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Thu, 24 Mar 2022 20:51:29 +0100 Subject: [PATCH] Fixed can fix --- main/can.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/can.cpp b/main/can.cpp index d459a67..815766a 100644 --- a/main/can.cpp +++ b/main/can.cpp @@ -280,7 +280,7 @@ void sendCanCommands() const auto status = twai_get_status_info(&status_info); const auto timestamp_after = espchrono::millis_clock::now(); - if ((result == ESP_ERR_TIMEOUT || status == TWAI_STATE_BUS_OFF) || (status == ESP_OK && status_info.bus_error_count > can_sequential_bus_errors)) + if ((result == ESP_ERR_TIMEOUT || status_info.state == TWAI_STATE_BUS_OFF) || (status == ESP_OK && status_info.bus_error_count > can_sequential_bus_errors)) { ++can_sequential_error_cnt; ++can_total_error_cnt;