mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
Code review by Dala
This commit is contained in:
parent
2ab1970e88
commit
bc6beaf1ab
4 changed files with 18 additions and 16 deletions
|
@ -19,8 +19,6 @@ const uint8_t sendingNumVariables = 0;
|
|||
#define SerialReceiver Serial2
|
||||
#endif
|
||||
|
||||
#define REPORT_SDL_DATA 1
|
||||
|
||||
// txid,rxid, num_send,num_recv
|
||||
SerialDataLink dataLinkReceive(SerialReceiver, 0, 0x01, sendingNumVariables,
|
||||
INVERTER_RECV_NUM_VARIABLES); // ...
|
||||
|
@ -55,8 +53,8 @@ void __getData() {
|
|||
void updateData() {
|
||||
// --- update with fresh data
|
||||
dataLinkReceive.updateData(0, inverterAllowsContactorClosing);
|
||||
//dataLinkReceive.updateData(1,var2);
|
||||
//dataLinkReceive.updateData(2,var3);
|
||||
//dataLinkReceive.updateData(1,var2); // For future expansion,
|
||||
//dataLinkReceive.updateData(2,var3); // if inverter needs to send data to battery
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -156,7 +154,7 @@ void manageSerialLinkReceiver() {
|
|||
// --- printUsefullData();
|
||||
//Serial.print("SOC = ");
|
||||
//Serial.println(SOC);
|
||||
#ifdef REPORT_SDL_DATA
|
||||
#ifdef DEBUG_VIA_USB
|
||||
update_values_serial_link();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -17,8 +17,6 @@ const uint8_t receivingNumVariables = BATTERY_RECV_NUM_VARIABLES;
|
|||
const uint8_t receivingNumVariables = 0;
|
||||
#endif
|
||||
|
||||
//#define REPORT_SDL_DATA 1
|
||||
|
||||
// txid,rxid,num_tx,num_rx
|
||||
SerialDataLink dataLinkTransmit(Serial2, 0x01, 0, BATTERY_SEND_NUM_VARIABLES, receivingNumVariables);
|
||||
|
||||
|
@ -26,8 +24,8 @@ void printSendingValues();
|
|||
|
||||
void _getData() {
|
||||
inverterAllowsContactorClosing = dataLinkTransmit.getReceivedData(0);
|
||||
//var2 = dataLinkTransmit.getReceivedData(1);
|
||||
//var3 = dataLinkTransmit.getReceivedData(2);
|
||||
//var2 = dataLinkTransmit.getReceivedData(1); // For future expansion,
|
||||
//var3 = dataLinkTransmit.getReceivedData(2); // if inverter needs to send data to battery
|
||||
}
|
||||
|
||||
void manageSerialLinkTransmitter() {
|
||||
|
@ -92,7 +90,7 @@ void manageSerialLinkTransmitter() {
|
|||
Serial.print(currentTime);
|
||||
Serial.println(" - Transmit Good");
|
||||
// printUsefullData();
|
||||
#ifdef REPORT_SDL_DATA
|
||||
#ifdef DEBUG_VIA_USB
|
||||
void printSendingValues();
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue