Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -rfba89d67dd2bef913e85a13563e2aa49f0e2e2f5 -rebbb1f85550a1f9b8f946655f7b2b63f76fbf67d --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision fba89d67dd2bef913e85a13563e2aa49f0e2e2f5) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision ebbb1f85550a1f9b8f946655f7b2b63f76fbf67d) @@ -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(); + } + /* TODO: The RPM is not converted properly. There will be a story to work on this issue. * This part of code is commented out until the RPM is calculated from ADC correctly. * There will be a story to address the RPM conversion.