Only leave TS_INACTIVE if SDC is closed

This commit is contained in:
Jasper Blanckenburg 2023-06-05 18:45:41 +02:00
parent cf018f9e4a
commit 6d6c1c1f15
1 changed files with 2 additions and 2 deletions

View File

@ -51,10 +51,10 @@ void ts_sm_update() {
} }
TSState ts_sm_update_inactive() { TSState ts_sm_update_inactive() {
if (ts_state.target_state == TS_ACTIVE) { if (ts_state.target_state == TS_ACTIVE && sdc_closed) {
precharge_95_reached_timestamp = 0; precharge_95_reached_timestamp = 0;
return TS_PRECHARGE; return TS_PRECHARGE;
} else if (ts_state.target_state == TS_CHARGING) { } else if (ts_state.target_state == TS_CHARGING && sdc_closed) {
charging_check_timestamp = HAL_GetTick(); charging_check_timestamp = HAL_GetTick();
return TS_CHARGING_CHECK; return TS_CHARGING_CHECK;
} }