From 9d8e20ce569b5362f8dfda0c88cd12797a38f661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96ster?= Date: Tue, 6 Aug 2024 14:40:57 +0300 Subject: [PATCH] Make dual LilyGo compile --- Software/Software.ino | 4 +++- Software/src/battery/BATTERIES.h | 7 +------ Software/src/battery/TEST-FAKE-BATTERY.cpp | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Software/Software.ino b/Software/Software.ino index ea443404..e0a918aa 100644 --- a/Software/Software.ino +++ b/Software/Software.ino @@ -535,7 +535,9 @@ void receive_can_native() { // This section checks if we have a complete CAN me if (xQueueReceive(CAN_cfg.rx_queue, &rx_frame, 0) == pdTRUE) { if (can_config.battery == CAN_NATIVE) { +#ifndef SERIAL_LINK_RECEIVER receive_can_battery(rx_frame); +#endif // SERIAL_LINK_RECEIVER } if (can_config.inverter == CAN_NATIVE) { #ifdef CAN_INVERTER_SELECTED @@ -901,7 +903,7 @@ void transmit_can(CAN_frame_t* tx_frame, int interface) { //Struct with ACAN2515 library format, needed to use the MCP2515 library for CAN2 CANMessage MCP2515Frame; MCP2515Frame.id = tx_frame->MsgID; - //MCP2515Frame.ext = false; //TODO: Howto handle this? + MCP2515Frame.ext = tx_frame->FIR.B.FF; MCP2515Frame.len = tx_frame->FIR.B.DLC; for (uint8_t i = 0; i < MCP2515Frame.len; i++) { MCP2515Frame.data[i] = tx_frame->data.u8[i]; diff --git a/Software/src/battery/BATTERIES.h b/Software/src/battery/BATTERIES.h index baef28fa..da671cac 100644 --- a/Software/src/battery/BATTERIES.h +++ b/Software/src/battery/BATTERIES.h @@ -1,7 +1,7 @@ #ifndef BATTERIES_H #define BATTERIES_H - #include "../../USER_SETTINGS.h" +#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h" // This include is annoying, consider defining a frame type in types.h #ifdef BMW_I3_BATTERY #include "BMW-I3-BATTERY.h" @@ -79,12 +79,7 @@ #include "SERIAL-LINK-RECEIVER-FROM-BATTERY.h" #endif -#ifdef SERIAL_LINK_RECEIVER // The serial thing does its thing -void receive_can_battery(); -#else -#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h" // This include is annoying, consider defining a frame type in types.h void receive_can_battery(CAN_frame_t rx_frame); -#endif #ifdef CAN_FD void receive_canfd_battery(CANFDMessage frame); #endif diff --git a/Software/src/battery/TEST-FAKE-BATTERY.cpp b/Software/src/battery/TEST-FAKE-BATTERY.cpp index 67ef68e5..a1de5bcc 100644 --- a/Software/src/battery/TEST-FAKE-BATTERY.cpp +++ b/Software/src/battery/TEST-FAKE-BATTERY.cpp @@ -1,7 +1,6 @@ #include "../include.h" #ifdef TEST_FAKE_BATTERY #include "../datalayer/datalayer.h" -#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h" #include "TEST-FAKE-BATTERY.h" /* Do not change code below unless you are sure what you are doing */