From 6cf33e80b81407da09d31eda755baa2da65a5f38 Mon Sep 17 00:00:00 2001 From: johannes Date: Sun, 6 Oct 2024 19:12:31 +0200 Subject: [PATCH] Reset EvseCurrent to 0 when outside state CurrentDemand --- ccs/pevStateMachine.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ccs/pevStateMachine.cpp b/ccs/pevStateMachine.cpp index d0ec63d..c42e078 100644 --- a/ccs/pevStateMachine.cpp +++ b/ccs/pevStateMachine.cpp @@ -1115,11 +1115,14 @@ static void pev_runFsm(void) if (connMgr_getConnectionLevel()==CONNLEVEL_80_TCP_RUNNING) { /* We have a TCP connection. This is the trigger for us. */ - if (pev_state==PEV_STATE_NotYetInitialized) pev_enterState(PEV_STATE_Connected); + if (pev_state == PEV_STATE_NotYetInitialized) pev_enterState(PEV_STATE_Connected); } stateFunctions[pev_state](); //call state function + if (pev_state != PEV_STATE_WaitForCurrentDemandResponse) //only in currentDemand we have meaningful current values + Param::SetInt(Param::EvseCurrent, 0); + if (pev_isTooLong()) pev_enterState(PEV_STATE_SequenceTimeout); }