Move SOH reading, add webserver string

This commit is contained in:
Daniel Öster 2024-07-29 16:09:49 +03:00
parent 9be8bc6455
commit 6eb0881553
2 changed files with 9 additions and 6 deletions

View file

@ -259,6 +259,12 @@ void receive_can_battery(CAN_frame_t rx_frame) {
cellvoltages_mv[82] = (rx_frame.data.u8[6] * 20); cellvoltages_mv[82] = (rx_frame.data.u8[6] * 20);
cellvoltages_mv[83] = (rx_frame.data.u8[7] * 20); cellvoltages_mv[83] = (rx_frame.data.u8[7] * 20);
} else if (poll_data_pid == 5) { } else if (poll_data_pid == 5) {
if (rx_frame.data.u8[6] > 0) {
batterySOH = rx_frame.data.u8[6];
}
if (batterySOH > 100) {
batterySOH = 100;
}
} }
break; break;
case 0x24: //Fourth datarow in PID group case 0x24: //Fourth datarow in PID group
@ -316,12 +322,6 @@ void receive_can_battery(CAN_frame_t rx_frame) {
//Map all cell voltages to the global array, we have sampled them all! //Map all cell voltages to the global array, we have sampled them all!
memcpy(datalayer.battery.status.cell_voltages_mV, cellvoltages_mv, 96 * sizeof(uint16_t)); memcpy(datalayer.battery.status.cell_voltages_mV, cellvoltages_mv, 96 * sizeof(uint16_t));
} else if (poll_data_pid == 5) { } else if (poll_data_pid == 5) {
if (rx_frame.data.u8[6] > 0) {
batterySOH = rx_frame.data.u8[6];
}
if (batterySOH > 100) {
batterySOH = 100;
}
} }
break; break;
case 0x26: //Sixth datarow in PID group case 0x26: //Sixth datarow in PID group

View file

@ -517,6 +517,9 @@ String processor(const String& var) {
#ifdef RENAULT_ZOE_GEN2_BATTERY #ifdef RENAULT_ZOE_GEN2_BATTERY
content += "Renault Zoe Gen2 50"; content += "Renault Zoe Gen2 50";
#endif #endif
#ifdef SANTA_FE_PHEV_BATTERY
content += "Santa Fe PHEV";
#endif
#ifdef SERIAL_LINK_RECEIVER #ifdef SERIAL_LINK_RECEIVER
content += "Serial link to another LilyGo board"; content += "Serial link to another LilyGo board";
#endif #endif