Lots of modifications... Hopefully the end

This commit is contained in:
Cabooman 2024-02-11 22:22:36 +01:00
parent e2faaecfd4
commit 6cb7e55dad
36 changed files with 345 additions and 210 deletions

View file

@ -1,5 +1,6 @@
#include "ESP32CAN.h"
#include <Arduino.h>
#include "../../devboard/utils/events.h"
int ESP32CAN::CANInit() {
return CAN_init();
@ -12,13 +13,14 @@ 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");
LEDcolor = 3;
set_event(EVENT_CAN_FAILURE, 0);
start_time = millis();
} else {
clear_event(EVENT_CAN_FAILURE);
}
} else {
if ((millis() - start_time) >= 2000) {
tx_ok = true;
LEDcolor = 0;
}
}
return result;

View file

@ -3,7 +3,6 @@
#include "../../lib/miwagner-ESP32-Arduino-CAN/CAN.h"
#include "../../lib/miwagner-ESP32-Arduino-CAN/CAN_config.h"
extern uint8_t LEDcolor;
class ESP32CAN {
public: