Merge pull request #793 from dalathegreat/bugfix/periodic-reset-event

Bugfix: Make PERIODIC_BMS_RESET not cause events after reset
This commit is contained in:
Matt Holmes 2025-01-17 18:56:03 +00:00 committed by GitHub
commit 41c8da1a29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -515,7 +515,10 @@ void handle_incoming_can_frame_battery2(CAN_frame rx_frame) {
battery2_Current2 |= 0xf800;
} //BatteryCurrentSignal , 2s comp, 1lSB = 0.5A/bit
battery2_Total_Voltage2 = ((rx_frame.data.u8[2] << 2) | (rx_frame.data.u8[3] & 0xc0) >> 6); //0.5V/bit
battery2_TEMP = ((rx_frame.data.u8[2] << 2) | (rx_frame.data.u8[3] & 0xc0) >> 6); //0.5V/bit
if (battery2_TEMP != 0x3ff) { //3FF is unavailable value. Can happen directly on reboot.
battery2_Total_Voltage2 = battery2_TEMP;
}
//Collect various data from the BMS
battery2_Relay_Cut_Request = ((rx_frame.data.u8[1] & 0x18) >> 3);
@ -754,7 +757,10 @@ void handle_incoming_can_frame_battery(CAN_frame rx_frame) {
battery_Current2 |= 0xf800;
} //BatteryCurrentSignal , 2s comp, 1lSB = 0.5A/bit
battery_Total_Voltage2 = ((rx_frame.data.u8[2] << 2) | (rx_frame.data.u8[3] & 0xc0) >> 6); //0.5V/bit
battery_TEMP = ((rx_frame.data.u8[2] << 2) | (rx_frame.data.u8[3] & 0xc0) >> 6); //0.5V/bit
if (battery_TEMP != 0x3ff) { //3FF is unavailable value. Can happen directly on reboot.
battery_Total_Voltage2 = battery_TEMP;
}
//Collect various data from the BMS
battery_Relay_Cut_Request = ((rx_frame.data.u8[1] & 0x18) >> 3);