mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Improve Afore writing of name
This commit is contained in:
parent
2546b6da21
commit
fdc1fb61ba
2 changed files with 4 additions and 10 deletions
|
@ -139,11 +139,10 @@ void AforeCanInverter::map_can_frame_to_variable(CAN_frame rx_frame) {
|
||||||
switch (rx_frame.ID) {
|
switch (rx_frame.ID) {
|
||||||
case 0x305: // Every 1s from inverter
|
case 0x305: // Every 1s from inverter
|
||||||
datalayer.system.status.CAN_inverter_still_alive = CAN_STILL_ALIVE;
|
datalayer.system.status.CAN_inverter_still_alive = CAN_STILL_ALIVE;
|
||||||
char0 = rx_frame.data.u8[0]; // A
|
for (uint8_t i = 0; i < 5; i++) {
|
||||||
char1 = rx_frame.data.u8[0]; // F
|
datalayer.system.info.inverter_brand[i] = rx_frame.data.u8[i];
|
||||||
char2 = rx_frame.data.u8[0]; // O
|
}
|
||||||
char3 = rx_frame.data.u8[0]; // R
|
datalayer.system.info.inverter_brand[7] = '\0';
|
||||||
char4 = rx_frame.data.u8[0]; // E
|
|
||||||
inverter_status = rx_frame.data.u8[7];
|
inverter_status = rx_frame.data.u8[7];
|
||||||
time_to_send_info = true;
|
time_to_send_info = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -16,11 +16,6 @@ class AforeCanInverter : public CanInverterProtocol {
|
||||||
uint8_t inverter_status =
|
uint8_t inverter_status =
|
||||||
0; //0 = init, 1 = standby, 2 = starting, 3 = grid connected, 4 off-grid, 5 diesel generator, 6 grid connected, but disconnected, 7off grid and disconnected, 8 = power failure processing, 9 = power off, 10 = Failure
|
0; //0 = init, 1 = standby, 2 = starting, 3 = grid connected, 4 off-grid, 5 diesel generator, 6 grid connected, but disconnected, 7off grid and disconnected, 8 = power failure processing, 9 = power off, 10 = Failure
|
||||||
bool time_to_send_info = false;
|
bool time_to_send_info = false;
|
||||||
uint8_t char0 = 0;
|
|
||||||
uint8_t char1 = 0;
|
|
||||||
uint8_t char2 = 0;
|
|
||||||
uint8_t char3 = 0;
|
|
||||||
uint8_t char4 = 0;
|
|
||||||
//Actual content messages
|
//Actual content messages
|
||||||
CAN_frame AFORE_350 = {.FD = false, // Operation information
|
CAN_frame AFORE_350 = {.FD = false, // Operation information
|
||||||
.ext_ID = false,
|
.ext_ID = false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue