Skip to content

Commit

Permalink
Update stm32_vcu.cpp
Browse files Browse the repository at this point in the history
Move settings of Opmode only after contactor delays.
  • Loading branch information
Tom-evnut authored Jan 27, 2025
1 parent ce2bc0b commit 3cb412f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/stm32_vcu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}

Expand Down

0 comments on commit 3cb412f

Please sign in to comment.