mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Merge branch 'main' into mqtt-cleanup
This commit is contained in:
commit
a74ae258c1
60 changed files with 1667 additions and 800 deletions
|
@ -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_TX_FAILURE, 0);
|
||||
start_time = millis();
|
||||
} else {
|
||||
clear_event(EVENT_CAN_TX_FAILURE);
|
||||
}
|
||||
} else {
|
||||
if ((millis() - start_time) >= 2000) {
|
||||
tx_ok = true;
|
||||
LEDcolor = 0;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue