Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r124b3745d056ac667280cfa0ae1fab8610d44ed2 -r1c628bfd5d6414b74b8cbd083f66839888a8236b --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 124b3745d056ac667280cfa0ae1fab8610d44ed2) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 1c628bfd5d6414b74b8cbd083f66839888a8236b) @@ -330,7 +330,7 @@ // Valve not in position cannot be requested // All the other positions are valid - if ( position != VALVE_POSITION_NOT_IN_POSITION && valve < NUM_OF_VALVES ) + if ( ( position < NUM_OF_VALVE_POSITIONS ) && ( position != VALVE_POSITION_NOT_IN_POSITION ) && ( valve < NUM_OF_VALVES ) ) { valvesStatus[ valve ].commandedPosition = position; valvesStatus[ valve ].hasTransitionBeenRequested = TRUE; @@ -874,8 +874,6 @@ if ( isAlarmActive( ALARM_ID_HD_VALVE_TRANSITION_TIMEOUT ) && valvesStatus[ valve ].commandedPosition == VALVE_POSITION_C_CLOSE ) { activateSafetyShutdown(); - // Set the alarm - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_VALVE_TRANSITION_TIMEOUT, (U32)valve ); } } // Check if the valve is close to the temporary target position and if it is, assign the next target position