diff --git a/Software/src/battery/ECMP-BATTERY.cpp b/Software/src/battery/ECMP-BATTERY.cpp index 16f276ac..b2532f49 100644 --- a/Software/src/battery/ECMP-BATTERY.cpp +++ b/Software/src/battery/ECMP-BATTERY.cpp @@ -191,6 +191,15 @@ void EcmpBattery::update_values() { datalayer_extended.stellantisECMP.pid_contactor_closing_counter = pid_contactor_closing_counter; datalayer_extended.stellantisECMP.pid_date_of_manufacture = pid_date_of_manufacture; datalayer_extended.stellantisECMP.pid_SOH_cell_1 = pid_SOH_cell_1; + // Update extended datalayer for MysteryVan + datalayer_extended.stellantisECMP.MysteryVan = MysteryVan; + datalayer_extended.stellantisECMP.CrashMemorized = HV_BATT_CRASH_MEMORIZED; + datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON = CONTACTOR_OPENING_REASON; + datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE = TBMU_FAULT_TYPE; + datalayer_extended.stellantisECMP.HV_BATT_FC_INSU_MINUS_RES = HV_BATT_FC_INSU_MINUS_RES; + datalayer_extended.stellantisECMP.HV_BATT_FC_INSU_PLUS_RES = HV_BATT_FC_INSU_PLUS_RES; + datalayer_extended.stellantisECMP.HV_BATT_FC_VHL_INSU_PLUS_RES = HV_BATT_FC_VHL_INSU_PLUS_RES; + datalayer_extended.stellantisECMP.HV_BATT_ONLY_INSU_MINUS_RES = HV_BATT_ONLY_INSU_MINUS_RES; if (battery_InterlockOpen) { set_event(EVENT_HVIL_FAILURE, 0); diff --git a/Software/src/battery/ECMP-HTML.h b/Software/src/battery/ECMP-HTML.h index 96bd56c6..2c2b6cd8 100644 --- a/Software/src/battery/ECMP-HTML.h +++ b/Software/src/battery/ECMP-HTML.h @@ -383,6 +383,58 @@ class EcmpHtmlRenderer : public BatteryHtmlRenderer { : String(datalayer_extended.stellantisECMP.pid_SOH_cell_1)) + ""; + if (datalayer_extended.stellantisECMP.MysteryVan) { + content += "

MysteryVan platform detected:

"; + content += "

Crash Memorized: "; + if (datalayer_extended.stellantisECMP.CrashMemorized == 255) { + content += "Yes

"; + } else { + content += "No"; + } + content += "

Contactor Opening Reason: "; + if (datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON == 0) { + content += "No error"; + } else if (datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON == 1) { + content += "Crash!"; + } else if (datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON == 2) { + content += "12V supply source undervoltage"; + } else if (datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON == 3) { + content += "12V supply source overvoltage"; + } else if (datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON == 4) { + content += "Battery temperature"; + } else if (datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON == 5) { + content += "Interlock line open"; + } else if (datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON == 6) { + content += "e-Service plug disconnected"; + } + content += "

"; + content += "

Battery fault type: "; + if (datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE == 0) { + content += "No fault"; + } else if (datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE == 1) { + content += "FirstLevelFault: Warning Lamp"; + } else if (datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE == 2) { + content += "SecondLevelFault: Stop Lamp"; + } else if (datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE == 3) { + content += "ThirdLevelFault: Stop Lamp + contactor opening (EPS shutdown)"; + } else if (datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE == 4) { + content += "FourthLevelFault: Stop Lamp + Active Discharge"; + } else if (datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE == 5) { + content += "Inhibition of powertrain activation"; + } else if (datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE == 6) { + content += "Reserved"; + } + content += "

"; + content += "

FC insulation minus resistance " + + String(datalayer_extended.stellantisECMP.HV_BATT_FC_INSU_MINUS_RES) + " kOhm

"; + content += "

FC insulation plus resistance " + + String(datalayer_extended.stellantisECMP.HV_BATT_FC_INSU_PLUS_RES) + " kOhm

"; + content += "

FC vehicle insulation plus resistance " + + String(datalayer_extended.stellantisECMP.HV_BATT_FC_VHL_INSU_PLUS_RES) + " kOhm

"; + content += "

FC vehicle insulation plus resistance " + + String(datalayer_extended.stellantisECMP.HV_BATT_ONLY_INSU_MINUS_RES) + " kOhm

"; + } + return content; } }; diff --git a/Software/src/datalayer/datalayer_extended.h b/Software/src/datalayer/datalayer_extended.h index b982e10f..5756a05a 100644 --- a/Software/src/datalayer/datalayer_extended.h +++ b/Software/src/datalayer/datalayer_extended.h @@ -235,6 +235,14 @@ struct DATALAYER_INFO_CMFAEV { }; struct DATALAYER_INFO_ECMP { + //mysteryvan parameters + bool MysteryVan = false; + bool CrashMemorized = false; + uint8_t CONTACTOR_OPENING_REASON = 0; + uint8_t TBMU_FAULT_TYPE = 0; + uint16_t HV_BATT_FC_INSU_MINUS_RES, HV_BATT_FC_INSU_PLUS_RES, HV_BATT_FC_VHL_INSU_PLUS_RES, + HV_BATT_ONLY_INSU_MINUS_RES = 0; + //ecmp below uint8_t MainConnectorState = 0; uint16_t InsulationResistance = 0; uint8_t InsulationDiag = 0;