Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -r22176ce95e49213c48454f34ddf5d29b8109f2cb -rbcf9339af8a725054a8c936ae572bb95e2bcd3f0 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 22176ce95e49213c48454f34ddf5d29b8109f2cb) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision bcf9339af8a725054a8c936ae572bb95e2bcd3f0) @@ -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 );