From 03f957f3e43537b2a00c26be7565bb2a27bf3e64 Mon Sep 17 00:00:00 2001 From: Jaakko Haakana Date: Mon, 2 Jun 2025 07:53:40 +0300 Subject: [PATCH] Move defines back to cpp file to avoid leakage --- Software/src/inverter/FERROAMP-CAN.cpp | 6 ++++++ Software/src/inverter/FERROAMP-CAN.h | 6 ------ Software/src/inverter/PYLON-CAN.cpp | 6 ++++++ Software/src/inverter/PYLON-CAN.h | 6 ------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Software/src/inverter/FERROAMP-CAN.cpp b/Software/src/inverter/FERROAMP-CAN.cpp index d9648a1b..89caa49e 100644 --- a/Software/src/inverter/FERROAMP-CAN.cpp +++ b/Software/src/inverter/FERROAMP-CAN.cpp @@ -3,6 +3,12 @@ #include "../datalayer/datalayer.h" #include "../include.h" +//#define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters) +#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters) +#define INVERT_LOW_HIGH_BYTES //If defined, certain frames will have inverted low/high bytes \ + //useful for some inverters like Sofar that report the voltages incorrect otherwise +#define SET_30K_OFFSET //If defined, current values are sent with a 30k offest (useful for ferroamp) + void FerroampCanInverter:: update_values() { //This function maps all the values fetched from battery CAN to the correct CAN messages //There are more mappings that could be added, but this should be enough to use as a starting point diff --git a/Software/src/inverter/FERROAMP-CAN.h b/Software/src/inverter/FERROAMP-CAN.h index 14a1c26a..4b8a9bf1 100644 --- a/Software/src/inverter/FERROAMP-CAN.h +++ b/Software/src/inverter/FERROAMP-CAN.h @@ -20,12 +20,6 @@ class FerroampCanInverter : public CanInverterProtocol { void send_system_data(); void send_setup_info(); -//#define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters) -#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters) -#define INVERT_LOW_HIGH_BYTES //If defined, certain frames will have inverted low/high bytes \ - //useful for some inverters like Sofar that report the voltages incorrect otherwise -#define SET_30K_OFFSET //If defined, current values are sent with a 30k offest (useful for ferroamp) - /* Some inverters need to see a specific amount of cells/modules to emulate a specific Pylon battery. Change the following only if your inverter is generating fault codes about voltage range */ static const int TOTAL_CELL_AMOUNT = 120; //Adjust this parameter in steps of 120 to add another 14,2kWh of capacity diff --git a/Software/src/inverter/PYLON-CAN.cpp b/Software/src/inverter/PYLON-CAN.cpp index b38da8cc..97da60df 100644 --- a/Software/src/inverter/PYLON-CAN.cpp +++ b/Software/src/inverter/PYLON-CAN.cpp @@ -3,6 +3,12 @@ #include "../datalayer/datalayer.h" #include "../include.h" +#define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters) +//#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters) +#define INVERT_LOW_HIGH_BYTES //If defined, certain frames will have inverted low/high bytes \ + //useful for some inverters like Sofar that report the voltages incorrect otherwise +//#define SET_30K_OFFSET //If defined, current values are sent with a 30k offest (useful for ferroamp) + void PylonInverter:: update_values() { //This function maps all the values fetched from battery CAN to the correct CAN messages diff --git a/Software/src/inverter/PYLON-CAN.h b/Software/src/inverter/PYLON-CAN.h index 53c8308d..cbcb6366 100644 --- a/Software/src/inverter/PYLON-CAN.h +++ b/Software/src/inverter/PYLON-CAN.h @@ -20,12 +20,6 @@ class PylonInverter : public CanInverterProtocol { void send_system_data(); void send_setup_info(); -#define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters) -//#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters) -#define INVERT_LOW_HIGH_BYTES //If defined, certain frames will have inverted low/high bytes \ - //useful for some inverters like Sofar that report the voltages incorrect otherwise - //#define SET_30K_OFFSET //If defined, current values are sent with a 30k offest (useful for ferroamp) - /* Some inverters need to see a specific amount of cells/modules to emulate a specific Pylon battery. Change the following only if your inverter is generating fault codes about voltage range */ static const int TOTAL_CELL_AMOUNT = 120;