run clang-format for all files except libraries in this repository

This commit is contained in:
lenvm 2023-11-08 23:06:06 +01:00
parent cb63316cd9
commit 6b6bf57804
38 changed files with 3438 additions and 2905 deletions

View file

@ -1,38 +1,33 @@
#include "ESP32CAN.h"
#include <Arduino.h>
int ESP32CAN::CANInit()
{
return CAN_init();
int ESP32CAN::CANInit() {
return CAN_init();
}
int ESP32CAN::CANWriteFrame(const CAN_frame_t* p_frame)
{
static unsigned long start_time;
int result = -1;
if(tx_ok){
result = CAN_write_frame(p_frame);
tx_ok = (result == 0) ? true : false;
if(tx_ok == false){
Serial.println("CAN failure! Check wires");
LEDcolor = 3;
start_time = millis();
}
int ESP32CAN::CANWriteFrame(const CAN_frame_t* p_frame) {
static unsigned long start_time;
int result = -1;
if (tx_ok) {
result = CAN_write_frame(p_frame);
tx_ok = (result == 0) ? true : false;
if (tx_ok == false) {
Serial.println("CAN failure! Check wires");
LEDcolor = 3;
start_time = millis();
}
else{
if((millis() - start_time) >= 2000){
tx_ok = true;
LEDcolor = 0;
}
} else {
if ((millis() - start_time) >= 2000) {
tx_ok = true;
LEDcolor = 0;
}
return result;
}
return result;
}
int ESP32CAN::CANStop()
{
return CAN_stop();
int ESP32CAN::CANStop() {
return CAN_stop();
}
int ESP32CAN::CANConfigFilter(const CAN_filter_t* p_filter)
{
return CAN_config_filter(p_filter);
int ESP32CAN::CANConfigFilter(const CAN_filter_t* p_filter) {
return CAN_config_filter(p_filter);
}
ESP32CAN ESP32Can;