From e396e8761c03d23abcc6483333a6ccbf1efce76c Mon Sep 17 00:00:00 2001 From: Cornelius Claussen Date: Wed, 11 Oct 2023 11:57:38 +0200 Subject: [PATCH] fix Signed-off-by: Cornelius Claussen --- modules/EvseManager/IECStateMachine.cpp | 2 ++ modules/EvseManager/Timeout.hpp | 1 - modules/simulation/JsYetiSimulator/index.js | 8 ++------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/EvseManager/IECStateMachine.cpp b/modules/EvseManager/IECStateMachine.cpp index 4aaebc867f..20dcbd7203 100644 --- a/modules/EvseManager/IECStateMachine.cpp +++ b/modules/EvseManager/IECStateMachine.cpp @@ -248,6 +248,8 @@ void IECStateMachine::feed_state_machine() { } if (timeout_state_c1.reached()) { + EVLOG_warning << "Timeout of 6 seconds reached, EV did not go back to state B after PWM was switch off. " + "Power off under load."; // We are still in state C, but the 6 seconds timeout has been reached. Now force power off under load. call_allow_power_on_bsp(false); } diff --git a/modules/EvseManager/Timeout.hpp b/modules/EvseManager/Timeout.hpp index c63e061958..e76d715eb9 100644 --- a/modules/EvseManager/Timeout.hpp +++ b/modules/EvseManager/Timeout.hpp @@ -88,7 +88,6 @@ class AsyncTimeout { if (!running) return false; if ((steady_clock::now() - start_time) > t) { - running = false; return true; } else { return false; diff --git a/modules/simulation/JsYetiSimulator/index.js b/modules/simulation/JsYetiSimulator/index.js index 6075d0aaed..f12db53e4b 100644 --- a/modules/simulation/JsYetiSimulator/index.js +++ b/modules/simulation/JsYetiSimulator/index.js @@ -236,12 +236,8 @@ function simulation_statemachine(mod) { if (!mod.pwm_running) { // C1 // Table A.6 Sequence 10.2: EV does not stop drawing power even // if PWM stops. Stop within 6 seconds (E.g. Kona1!) - // if (mod.last_pwm_running) FIXME implement 6 second timer! - // startTimer(6000); - // if (timerElapsed()) { - // force power off under load - powerOff(mod); - // } + // This is implemented in EvseManager + if (!mod.power_on_allowed) powerOff(mod); } else { // C2 if (mod.power_on_allowed) { // Table A.6: Sequence 4 EV ready to charge.