Add PSU diagnostic logging for setpoints and state transitions (v1.0.26).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
raduet
2026-07-06 09:19:36 +02:00
co-authored by Cursor
parent 49a4fd8ee1
commit 96826da0e0
6 changed files with 7644 additions and 7341 deletions
+32 -13
View File
@@ -330,22 +330,41 @@ void CCS_SerialLoop(void) {
}
// 10s timeout: enforce safe-state until host communication recovers.
if (host_timeout_stop) {
CONN.EnableOutput = 0;
CCS_EvseState = Unknown;
CP_SetDuty(100);
if (CCS_ConnectorState != CCS_DISABLED && CCS_ConnectorState != CCS_UNKNOWN) {
CCS_ConnectorState = CCS_DISABLED;
}
} else {
if (last_cmd == CMD_STOP) {
{
static uint8_t prev_enable_output = 0xFFu;
uint8_t new_enable_output;
if (host_timeout_stop) {
CONN.EnableOutput = 0;
} else {
CONN.EnableOutput = ev_enable_output ? 1 : 0;
if((CONN.EnableOutput == 0) && (CONN.connState == Preparing)){
CONN.EnableOutput = 0;
CCS_EvseState = Unknown;
CP_SetDuty(100);
if (CCS_ConnectorState != CCS_DISABLED && CCS_ConnectorState != CCS_UNKNOWN) {
CCS_ConnectorState = CCS_DISABLED;
}
new_enable_output = 0u;
} else {
if (last_cmd == CMD_STOP) {
CONN.EnableOutput = 0;
} else {
CONN.EnableOutput = ev_enable_output ? 1 : 0;
if((CONN.EnableOutput == 0) && (CONN.connState == Preparing)){
CONN.EnableOutput = 0;
}
}
new_enable_output = CONN.EnableOutput;
}
if (prev_enable_output != 0xFFu && prev_enable_output != new_enable_output) {
log_printf(LOG_INFO,
"EnableOutput %u->%u ev=%u stop=%u host_to=%u err=%u\n",
(unsigned)prev_enable_output,
(unsigned)new_enable_output,
(unsigned)ev_enable_output,
(unsigned)(last_cmd == CMD_STOP),
(unsigned)host_timeout_stop,
(unsigned)CONN.chargingError);
}
prev_enable_output = new_enable_output;
}
if ((cp_state_buffer == EV_STATE_B_CONN_PREP) ||