Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -rccf1219089b835ab2f9d401c0be0d2000be9010a -r5cee5f88d4d3f18b4178621f1ef175b0873d6248 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision ccf1219089b835ab2f9d401c0be0d2000be9010a) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 5cee5f88d4d3f18b4178621f1ef175b0873d6248) @@ -72,6 +72,8 @@ #define SAFETY_SHUTDOWN_TIMEOUT MS_PER_SECOND ///< Drain pump safety shutdown activation timeout. +#define DRAIN_PUMP_OFF_RPM_ADC_COUNT 0xFFFF ///< ADC count value when pump is off. + /// Enumeration of drain pump states. typedef enum DrainPump_States { @@ -249,9 +251,18 @@ *************************************************************************/ void execDrainPumpMonitor( void ) { - // Convert speed ADC to RPM - currentDrainPumpRPM = CONVERSION_COEFF / getFPGADrainPumpSpeed(); + U16 const fpgaADCSpeedCount = getFPGADrainPumpSpeed(); + if ( DRAIN_PUMP_OFF_RPM_ADC_COUNT == fpgaADCSpeedCount ) + { + currentDrainPumpRPM = 0; + } + else + { + // Convert speed ADC to RPM + currentDrainPumpRPM = CONVERSION_COEFF / getFPGADrainPumpSpeed(); + } + // The RPM is only checked in open loop state that the pump is run at a fixed RPM. // The persistent alarm waits for a couple of seconds before raising an alarm, this is supposed to cover // when the pump is turned on and it takes a while to ramp up to target RPM.