Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -rccf1219089b835ab2f9d401c0be0d2000be9010a -rab447ebbc380f4c7abc2ae283042a5d0c9e1b9cb --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision ccf1219089b835ab2f9d401c0be0d2000be9010a) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision ab447ebbc380f4c7abc2ae283042a5d0c9e1b9cb) @@ -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,13 +251,23 @@ *************************************************************************/ 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(); + } + + // TODO this is disabled until RPM is calculated propely. // 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. - if( drainPumpControlModeSet == PUMP_CONTROL_MODE_OPEN_LOOP ) + /*if( drainPumpControlModeSet == PUMP_CONTROL_MODE_OPEN_LOOP ) { U32 targetRPM = getTargetDrainPumpRPM(); F32 threshold = OPEN_LOOP_RPM_OUT_OF_RANGE * targetRPM; @@ -278,7 +290,7 @@ { activateSafetyShutdown(); } - } + }*/ // Publish drain pump data on interval publishDrainPumpData();