Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r0a4dcd288d4347b85baaa0b07da568b6add5eac7 -r5b919b77ea248b5fec3511857ed910ecfc0a1955 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 0a4dcd288d4347b85baaa0b07da568b6add5eac7) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 5b919b77ea248b5fec3511857ed910ecfc0a1955) @@ -7,8 +7,8 @@ * * @file Valves.c * -* @author (last) Dara Navaei -* @date (last) 03-Nov-2022 +* @author (last) Darren Cox +* @date (last) 12-Jan-2023 * * @author (original) Dara Navaei * @date (original) 07-Aug-2020 @@ -478,6 +478,19 @@ /*********************************************************************//** * @brief + * The resetValvesPOSTState function resets the valves POST state; + * @details Inputs: none + * @details Outputs: valveSelfTestState, valvesSelfTestResult + * @return none + *************************************************************************/ +void resetValvesPOSTState( void ) +{ + valveSelfTestState = VALVE_SELF_TEST_ENABLE_VALVES; + valvesSelfTestResult = SELF_TEST_STATUS_IN_PROGRESS; +} + +/*********************************************************************//** + * @brief * The execValves function executes the valves exec state machine. * @details Inputs: valvesStatus * @details Outputs: valvesStatus @@ -1171,7 +1184,7 @@ for ( valve = VDI; valve < NUM_OF_VALVES; valve++ ) { // Check the valve is in Idle state, otherwise the position should not be checked - if ( valvesStatus[ valve ].execState == VALVE_STATE_IDLE ) + if ( ( valvesStatus[ valve ].execState == VALVE_STATE_IDLE ) && ( FALSE == isAlarmActive( ALARM_ID_HD_AC_POWER_LOST ) ) ) { U32 maxDeviation = MAX_DEVIATION_FROM_TARGET_IN_COUNTS; @@ -1203,6 +1216,10 @@ valvesStatus[ valve ].positionOutOfRangeCounter = 0; } } + else + { + valvesStatus[ valve ].positionOutOfRangeCounter = 0; + } } }