Make dual LilyGo compile

This commit is contained in:
Daniel Öster 2024-08-06 14:40:57 +03:00
parent c34bc58c8a
commit 9d8e20ce56
3 changed files with 4 additions and 8 deletions

View file

@ -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 (xQueueReceive(CAN_cfg.rx_queue, &rx_frame, 0) == pdTRUE) {
if (can_config.battery == CAN_NATIVE) { if (can_config.battery == CAN_NATIVE) {
#ifndef SERIAL_LINK_RECEIVER
receive_can_battery(rx_frame); receive_can_battery(rx_frame);
#endif // SERIAL_LINK_RECEIVER
} }
if (can_config.inverter == CAN_NATIVE) { if (can_config.inverter == CAN_NATIVE) {
#ifdef CAN_INVERTER_SELECTED #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 //Struct with ACAN2515 library format, needed to use the MCP2515 library for CAN2
CANMessage MCP2515Frame; CANMessage MCP2515Frame;
MCP2515Frame.id = tx_frame->MsgID; 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; MCP2515Frame.len = tx_frame->FIR.B.DLC;
for (uint8_t i = 0; i < MCP2515Frame.len; i++) { for (uint8_t i = 0; i < MCP2515Frame.len; i++) {
MCP2515Frame.data[i] = tx_frame->data.u8[i]; MCP2515Frame.data[i] = tx_frame->data.u8[i];

View file

@ -1,7 +1,7 @@
#ifndef BATTERIES_H #ifndef BATTERIES_H
#define BATTERIES_H #define BATTERIES_H
#include "../../USER_SETTINGS.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 #ifdef BMW_I3_BATTERY
#include "BMW-I3-BATTERY.h" #include "BMW-I3-BATTERY.h"
@ -79,12 +79,7 @@
#include "SERIAL-LINK-RECEIVER-FROM-BATTERY.h" #include "SERIAL-LINK-RECEIVER-FROM-BATTERY.h"
#endif #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); void receive_can_battery(CAN_frame_t rx_frame);
#endif
#ifdef CAN_FD #ifdef CAN_FD
void receive_canfd_battery(CANFDMessage frame); void receive_canfd_battery(CANFDMessage frame);
#endif #endif

View file

@ -1,7 +1,6 @@
#include "../include.h" #include "../include.h"
#ifdef TEST_FAKE_BATTERY #ifdef TEST_FAKE_BATTERY
#include "../datalayer/datalayer.h" #include "../datalayer/datalayer.h"
#include "../lib/miwagner-ESP32-Arduino-CAN/ESP32CAN.h"
#include "TEST-FAKE-BATTERY.h" #include "TEST-FAKE-BATTERY.h"
/* Do not change code below unless you are sure what you are doing */ /* Do not change code below unless you are sure what you are doing */