forked from achamaikin/CCSModuleSW30Web
Ignore expected PSU output drop after Everest Mode Off (v1.0.32).
Disarm sudden-off diagnostics when host setpoint is already 0 V / 0 A so ISO15118 Welding teardown no longer logs false output_lost. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+10
-1
@@ -162,6 +162,10 @@ static void PSU_LogActiveStatusFlags(LogLevel_t level)
|
||||
*
|
||||
* Note: PSU_enabled is derived from V >= PSU_VOLTAGE_THRESHOLD, not from
|
||||
* the module enable command bit.
|
||||
*
|
||||
* Host Mode::Off (CMD_E2M_SET_OUTPUT_VOLTAGE 0/0) arrives before
|
||||
* allow_power_on=false during ISO15118 Welding. That is an expected V drop
|
||||
* while EnableOutput is still 1 — do not treat it as output_lost.
|
||||
*/
|
||||
static void PSU_MonitorStatusAndUnexpectedOff(void)
|
||||
{
|
||||
@@ -176,15 +180,19 @@ static void PSU_MonitorStatusAndUnexpectedOff(void)
|
||||
uint32_t now = HAL_GetTick();
|
||||
uint8_t in_charging;
|
||||
uint8_t watch_status;
|
||||
uint8_t host_export_off;
|
||||
uint8_t expect_on;
|
||||
|
||||
in_charging = (CONN.connState == Charging);
|
||||
/* Everest setMode(Off) → SET_OUTPUT 0 V / 0 A; contactors may stay closed. */
|
||||
host_export_off = (CONN.WantedCurrent == 0u) || (CONN.RequestedVoltage == 0u);
|
||||
watch_status = in_charging && (CONN.EnableOutput != 0) && (PSU0.online != 0) &&
|
||||
((PSU0.state == PSU_CONNECTED) ||
|
||||
(PSU0.state == PSU_WAIT_ACK_ON) ||
|
||||
(PSU0.state == PSU_CONT_WAIT_ACK_ON));
|
||||
|
||||
expect_on = in_charging && (CONN.EnableOutput != 0) && (PSU0.state == PSU_CONNECTED);
|
||||
expect_on = in_charging && (CONN.EnableOutput != 0) && (PSU0.state == PSU_CONNECTED) &&
|
||||
!host_export_off;
|
||||
|
||||
if (!inited) {
|
||||
prev_s0 = PSU0.status0.raw;
|
||||
@@ -215,6 +223,7 @@ static void PSU_MonitorStatusAndUnexpectedOff(void)
|
||||
if (!expect_on) {
|
||||
sudden_cand_ms = 0u;
|
||||
if ((CONN.EnableOutput == 0) ||
|
||||
host_export_off ||
|
||||
(CONN.connState != Charging) ||
|
||||
(PSU0.state == PSU_READY) ||
|
||||
(PSU0.state == PSU_UNREADY) ||
|
||||
|
||||
Reference in New Issue
Block a user