From 3cb412fa576aa219531771765e7ef197f21976c9 Mon Sep 17 00:00:00 2001 From: Tom_evnut Date: Mon, 27 Jan 2025 17:28:00 +0000 Subject: [PATCH] Update stm32_vcu.cpp Move settings of Opmode only after contactor delays. --- src/stm32_vcu.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stm32_vcu.cpp b/src/stm32_vcu.cpp index 8c04aa3..b14973f 100644 --- a/src/stm32_vcu.cpp +++ b/src/stm32_vcu.cpp @@ -689,14 +689,15 @@ static void Ms10Task(void) if(rlyDly==0) { DigIo::dcsw_out.Set(); + Param::SetInt(Param::opmode, opmode);//Only set opmode to charge once Main Contactor is shut. } ErrorMessage::UnpostAll(); if(!chargeMode) { opmode = MOD_OFF; rlyDly=250;//Recharge sequence timer for delayed shutdown + Param::SetInt(Param::opmode, opmode); //set opmode to OFF when leaving charge state } - Param::SetInt(Param::opmode, opmode); break; case MOD_RUN: @@ -705,15 +706,15 @@ static void Ms10Task(void) { DigIo::dcsw_out.Set(); DigIo::inv_out.Set();//inverter power on + Param::SetInt(Param::opmode, MOD_RUN); //Only set opmode to Run once main contactor is shut } - Param::SetInt(Param::opmode, MOD_RUN); ErrorMessage::UnpostAll(); if(!selectedVehicle->Ready()) { opmode = MOD_OFF; rlyDly=250;//Recharge sequence timer for delayed shutdown + Param::SetInt(Param::opmode, opmode); //set opmode to OFF when leaving charge state } - Param::SetInt(Param::opmode, opmode); break; }