Skip to content

Commit

Permalink
Add sending inverter values back
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Nov 27, 2023
1 parent f3c848a commit 956aa8a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
10 changes: 4 additions & 6 deletions Software/src/battery/SERIAL-LINK-RECEIVER-FROM-BATTERY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "SERIAL-LINK-RECEIVER-FROM-BATTERY.h"

//#define INVERTER_SEND_NUM_VARIABLES 3 //--- comment out if nothing to send
#define INVERTER_SEND_NUM_VARIABLES 1
#define INVERTER_RECV_NUM_VARIABLES 16

#ifdef INVERTER_SEND_NUM_VARIABLES
Expand Down Expand Up @@ -36,11 +36,9 @@ void __getData() {

void updateData() {
// --- update with fresh data
/*
dataLinkReceive.updateData(0,var1);
dataLinkReceive.updateData(1,var2);
dataLinkReceive.updateData(2,var3);
*/
dataLinkReceive.updateData(0, inverterAllowsContactorClosing);
//dataLinkReceive.updateData(1,var2);
//dataLinkReceive.updateData(2,var3);
}

/*
Expand Down
3 changes: 2 additions & 1 deletion Software/src/battery/SERIAL-LINK-RECEIVER-FROM-BATTERY.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 funct
extern uint16_t cell_max_voltage; //mV, 0-4350
extern uint16_t cell_min_voltage; //mV, 0-4350
extern uint8_t LEDcolor; //Enum, 0-10
extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false
extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false
extern bool inverterAllowsContactorClosing; //Bool, 1=true, 0=false

void manageSerialLinkReceiver();

Expand Down
10 changes: 4 additions & 6 deletions Software/src/inverter/SERIAL-LINK-TRANSMITTER-INVERTER.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

#define BATTERY_SEND_NUM_VARIABLES 16
//#define BATTERY_RECV_NUM_VARIABLES 3 //--- comment out if nothing to receive
#define BATTERY_RECV_NUM_VARIABLES 1

#ifdef BATTERY_RECV_NUM_VARIABLES
const uint8_t receivingNumVariables = BATTERY_RECV_NUM_VARIABLES;
Expand All @@ -21,11 +21,9 @@ const uint8_t receivingNumVariables = 0;
SerialDataLink dataLinkTransmit(Serial2, 0x01, 0, BATTERY_SEND_NUM_VARIABLES, receivingNumVariables);

void _getData() {
/*
var1 = dataLinkTransmit.getReceivedData(0);
var2 = dataLinkTransmit.getReceivedData(1);
var3 = dataLinkTransmit.getReceivedData(2);
*/
inverterAllowsContactorClosing = dataLinkTransmit.getReceivedData(0);
//var2 = dataLinkTransmit.getReceivedData(1);
//var3 = dataLinkTransmit.getReceivedData(2);
}

void manageSerialLinkTransmitter() {
Expand Down
3 changes: 2 additions & 1 deletion Software/src/inverter/SERIAL-LINK-TRANSMITTER-INVERTER.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 funct
extern uint16_t cell_max_voltage; //mV, 0-4350
extern uint16_t cell_min_voltage; //mV, 0-4350
extern uint8_t LEDcolor; //Enum, 0-10
extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false
extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false
extern bool inverterAllowsContactorClosing; //Bool, 1=true, 0=false

void manageSerialLinkTransmitter();

Expand Down

0 comments on commit 956aa8a

Please sign in to comment.