diff --git a/Core/Src/ts_state_machine.c b/Core/Src/ts_state_machine.c index d885519..66fbc3b 100644 --- a/Core/Src/ts_state_machine.c +++ b/Core/Src/ts_state_machine.c @@ -79,6 +79,7 @@ TSState ts_sm_update_precharge() { if (precharge_95_reached_timestamp == 0) { precharge_95_reached_timestamp = now; } else if (now - precharge_95_reached_timestamp >= PRECHARGE_95_DURATION) { + precharge_95_reached_timestamp = 0; return TS_ACTIVE; } } @@ -98,6 +99,7 @@ TSState ts_sm_update_error() { if (no_error_since == 0) { no_error_since = now; } else if (now - no_error_since > NO_ERROR_TIME) { + no_error_since = 0; return TS_INACTIVE; } }