Improvement: Tesla blown pyro event (#808)

* Remove unnecessary includes

* Add fuse blown event for Tesla
This commit is contained in:
Daniel Öster 2025-01-21 11:10:31 +03:00 committed by GitHub
parent ffe583d551
commit eb3ea8dbb4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 12 deletions

View file

@ -887,12 +887,18 @@ void update_values_battery() { //This function maps all the values fetched via
/* Value mapping is completed. Start to check all safeties */
if (battery_hvil_status ==
3) { //INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
//INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
if (battery_hvil_status == 3) {
set_event(EVENT_INTERNAL_OPEN_FAULT, 0);
} else {
clear_event(EVENT_INTERNAL_OPEN_FAULT);
}
//Voltage missing, pyrofuse most likely blown
if (datalayer.battery.status.voltage_dV == 10) {
set_event(EVENT_BATTERY_FUSE, 0);
} else {
clear_event(EVENT_BATTERY_FUSE);
}
#ifdef TESLA_MODEL_3Y_BATTERY
// Autodetect algoritm for chemistry on 3/Y packs.
@ -2585,13 +2591,18 @@ void update_values_battery2() { //This function maps all the values fetched via
battery2_cell_deviation_mV = (battery2_cell_max_v - battery2_cell_min_v);
/* Value mapping is completed. Start to check all safeties */
if (battery2_hvil_status ==
3) { //INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
//INTERNAL_OPEN_FAULT - Someone disconnected a high voltage cable while battery was in use
if (battery2_hvil_status == 3) {
set_event(EVENT_INTERNAL_OPEN_FAULT, 2);
} else {
clear_event(EVENT_INTERNAL_OPEN_FAULT);
}
//Voltage missing, pyrofuse most likely blown
if (datalayer.battery2.status.voltage_dV == 10) {
set_event(EVENT_BATTERY_FUSE, 0);
} else {
clear_event(EVENT_BATTERY_FUSE);
}
#ifdef TESLA_MODEL_3Y_BATTERY
// Autodetect algoritm for chemistry on 3/Y packs.