Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -r22176ce95e49213c48454f34ddf5d29b8109f2cb -ra89d6b091874136d75a9bfbdbbc1ff00f42467b3 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 22176ce95e49213c48454f34ddf5d29b8109f2cb) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision a89d6b091874136d75a9bfbdbbc1ff00f42467b3) @@ -8,7 +8,7 @@ * @file DrainPump.c * * @author (last) Dara Navaei -* @date (last) 20-Apr-2022 +* @date (last) 11-Jul-2022 * * @author (original) Sean * @date (original) 08-Apr-2020 @@ -183,7 +183,7 @@ // If this function was called, delayed command does not need to be executed // so the pending count down is zeroed. pendingDrainPumpCmdCountDown = 0; - result = TRUE; + result = TRUE; } else { @@ -324,18 +324,9 @@ *************************************************************************/ void execDrainPumpMonitor( void ) { - U16 const fpgaADCSpeedCount = getFPGADrainPumpSpeed(); + U16 fpgaADCSpeedCount = getFPGADrainPumpSpeed(); + drainPumpMeasuredRPM.data = ( DRAIN_PUMP_OFF_RPM_ADC_COUNT == fpgaADCSpeedCount ? 0 : ( CONVERSION_COEFF / fpgaADCSpeedCount ) ); - if ( DRAIN_PUMP_OFF_RPM_ADC_COUNT == fpgaADCSpeedCount ) - { - drainPumpMeasuredRPM.data = 0; - } - else - { - // Convert speed ADC to RPM - drainPumpMeasuredRPM.data = CONVERSION_COEFF / getFPGADrainPumpSpeed(); - } - #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_DRAIN_PUMP_MONITOR ) != SW_CONFIG_ENABLE_VALUE ) #endif @@ -358,9 +349,7 @@ else if ( DRAIN_PUMP_OPEN_LOOP_STATE == drainPumpState ) { // Using abs since the read RPM can be above or below the target - U32 rpmDiff = abs( getDrainPumpTargetRPM() - getDrainPumpMeasuredRPM() ); - - // Check if RPM is out of range + U32 rpmDiff = abs( getDrainPumpTargetRPM() - getDrainPumpMeasuredRPM() ); BOOL isRPMOutOfRange = ( rpmDiff > MAX_ALLOWED_OPEN_LOOP_RPM_OUT_OF_RANGE ? TRUE : FALSE ); checkPersistentAlarm( ALARM_ID_DRAIN_PUMP_RPM_OUT_OF_RANGE, isRPMOutOfRange, getDrainPumpMeasuredRPM(), MAX_ALLOWED_OPEN_LOOP_RPM_OUT_OF_RANGE );