Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r07e2e63c1d8ff6fd3e967d72f27a60cba07014d1 -r0772fa437a0f4bcbb58fbad9d6e1f0054efd0e28 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 07e2e63c1d8ff6fd3e967d72f27a60cba07014d1) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 0772fa437a0f4bcbb58fbad9d6e1f0054efd0e28) @@ -19,7 +19,6 @@ #include "reg_het.h" #include "gio.h" -#include "Battery.h" #include "CPLD.h" #include "FPGA.h" #include "MessageSupport.h" @@ -926,7 +925,7 @@ state = VALVE_STATE_IDLE; } // Check if the valve's transition time has timed out - else if ( ( TRUE == didTimeout( valvesStatus[ valve ].transitionStartTime, VALVE_TRANSITION_TIMEOUT_MS ) ) && ( FALSE == isACPowerLost() ) ) + else if ( ( TRUE == didTimeout( valvesStatus[ valve ].transitionStartTime, VALVE_TRANSITION_TIMEOUT_MS ) ) && ( getCPLDACPowerLossDetected() != TRUE ) ) { // Go back to Idle state and set the valve position to not in position because it was not able to get to the target position valvesStatus[ valve ].currentPosition = VALVE_POSITION_NOT_IN_POSITION; @@ -1188,7 +1187,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 ) && ( FALSE == getCPLDACPowerLossDetected() ) ) + if ( ( valvesStatus[ valve ].execState == VALVE_STATE_IDLE ) && ( getCPLDACPowerLossDetected() != TRUE ) ) { U32 maxDeviation = MAX_DEVIATION_FROM_TARGET_IN_COUNTS;