mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Improvement: Tesla blown pyro event (#808)
* Remove unnecessary includes * Add fuse blown event for Tesla
This commit is contained in:
parent
ffe583d551
commit
eb3ea8dbb4
5 changed files with 16 additions and 12 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue