mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 19:42:08 +02:00
Add sending inverter values back
This commit is contained in:
parent
f3c848a567
commit
956aa8a712
4 changed files with 12 additions and 14 deletions
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue