Skip to content

Commit

Permalink
Invert min-max
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Feb 4, 2024
1 parent dc84b15 commit aecf2bb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Software/src/inverter/PYLON-CAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,17 @@ void update_values_can_pylon() { //This function maps all the values fetched fr
PYLON_4211.data.u8[7] = (StateOfHealth * 0.01);

#ifdef INVERT_VOLTAGE //Useful for Sofar inverters
//Minvoltage (eg 300.0V = 3000 , 16bits long) Charge Cutoff Voltage
PYLON_4220.data.u8[0] = (min_voltage & 0x00FF);
PYLON_4220.data.u8[1] = (min_voltage >> 8);
PYLON_4221.data.u8[0] = (min_voltage & 0x00FF);
PYLON_4221.data.u8[1] = (min_voltage >> 8);
//Maxvoltage (eg 400.0V = 4000 , 16bits long) Discharge Cutoff Voltage
PYLON_4220.data.u8[0] = (max_voltage & 0x00FF);
PYLON_4220.data.u8[1] = (max_voltage >> 8);
PYLON_4221.data.u8[0] = (max_voltage & 0x00FF);
PYLON_4221.data.u8[1] = (max_voltage >> 8);

//Maxvoltage (eg 400.0V = 4000 , 16bits long) Discharge Cutoff Voltage
PYLON_4220.data.u8[2] = (max_voltage & 0x00FF);
PYLON_4220.data.u8[3] = (max_voltage >> 8);
PYLON_4221.data.u8[2] = (max_voltage & 0x00FF);
PYLON_4221.data.u8[3] = (max_voltage >> 8);
//Minvoltage (eg 300.0V = 3000 , 16bits long) Charge Cutoff Voltage
PYLON_4220.data.u8[2] = (min_voltage & 0x00FF);
PYLON_4220.data.u8[3] = (min_voltage >> 8);
PYLON_4221.data.u8[2] = (min_voltage & 0x00FF);
PYLON_4221.data.u8[3] = (min_voltage >> 8);
#else
//Minvoltage (eg 300.0V = 3000 , 16bits long) Charge Cutoff Voltage
PYLON_4220.data.u8[0] = (min_voltage >> 8);
Expand Down

0 comments on commit aecf2bb

Please sign in to comment.