Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r8ac6dbd310f7408760e5cad232b1e9834882f739 -r254faac62b851c393c5df753eade2dc880b83247 --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 8ac6dbd310f7408760e5cad232b1e9834882f739) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision 254faac62b851c393c5df753eade2dc880b83247) @@ -227,12 +227,6 @@ static OPN_CLS_STATE_T valveAirTrapStatus; ///< Air trap valve status (open/close) static HD_VALVES_CAL_RECORD_T valvesCalibrationRecord; ///< Valves calibration record. -// TODO remove for testing only -static S32 testPos[ NUM_OF_VALVES ][300]; -static F32 testCurr[ NUM_OF_VALVES ][ 300 ]; -static U32 idx[ NUM_OF_VALVES ] = {0,0,0,0}; -// TODO remove for testing only - // Self test function prototypes static VALVE_SELF_TEST_STATE_T handleValveSelfTestEnableValves( void ); static VALVE_SELF_TEST_STATE_T handleValveSelfTestConfirmEnable( void ); @@ -1163,20 +1157,6 @@ valvesStatus[ VBA ].currentPositionInCounts.data = (S32)getFPGAValveBloodArterialPosition(); valvesStatus[ VBV ].currentPositionInCounts.data = (S32)getFPGAValveBloodVenousPosition(); - testPos[VDI][ idx[VDI] ] = valvesStatus[ VDI ].currentPositionInCounts.data; - testCurr[VDI][ idx[VDI] ] = valvesStatus[ VDI ].current.data; - idx[VDI] = INC_WRAP(idx[VDI], 0, 300); - - testPos[VDO][ idx[VDO] ] = valvesStatus[ VDO ].currentPositionInCounts.data; - idx[VDO] = INC_WRAP(idx[VDO], 0, 300); - - testPos[VBA][ idx[VBA] ] = valvesStatus[ VBA ].currentPositionInCounts.data; - idx[VBA] = INC_WRAP(idx[VBA], 0, 300); - - testPos[VBV][ idx[VBV] ] = valvesStatus[ VBV ].currentPositionInCounts.data; - testCurr[VBV][ idx[VBV] ] = valvesStatus[ VBV ].current.data; - idx[VBV] = INC_WRAP(idx[VBV], 0, 300); - // Check the position of each valve for ( valve = VDI; valve < NUM_OF_VALVES; valve++ ) { @@ -1203,7 +1183,8 @@ valvesStatus[ valve ].positionOutOfRangeCounter++; } - if ( valvesStatus[ valve ].positionOutOfRangeCounter > MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER ) + if ( ( valvesStatus[ valve ].positionOutOfRangeCounter > MAX_POS_DEVIATION_TIME_INTERVAL_COUNTER ) && + ( TRUE == isAlarmActive( ALARM_ID_HD_AC_POWER_LOST ) ) ) { SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_VALVE_POSITION_OUT_OF_RANGE, (U32)valve, currentPosition ); }