Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -r18d12a2d88ac4d03840a2b5cfce41090b2a9bb54 -rc4ea2fbaae71d7beca3879c0970d488f169ebae4 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 18d12a2d88ac4d03840a2b5cfce41090b2a9bb54) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision c4ea2fbaae71d7beca3879c0970d488f169ebae4) @@ -73,6 +73,8 @@ #define DATA_PUBLISH_COUNTER_START_COUNT 0 ///< Data publish counter start count. +#define ZERO_REVOLUTION_COUNT 0 ///< Revolution count reached to Zero. + #define CONCENTRATE_PUMP_FAULT_PERSISTENCE_PERIOD 500 ///< Concentrate pump fault persistence period in milliseconds. #define CONCENTRATE_PUMP_TRANS_TO_RAMP_SPEED_THRESHOLD_MLPM 20.0F ///< Concentrate pump transition to ramp to target speed threshold in mL/min. @@ -98,7 +100,6 @@ CONCENTRATE_PUMP_CONTROL_REVERSE_DIR | CONCENTRATE_PUMP_CONTROL_EIGHTH_STEP; ///< Concentrate pump control reverse. - /// Enumeration of concentrate pump states. typedef enum ConcentratePumpState { @@ -665,7 +666,7 @@ *************************************************************************/ U16 getConcPumpTargetRevolutionCount( CONCENTRATE_PUMPS_T pumpId ) { - BOOL result = FALSE; + U16 result = 0; if ( pumpId < NUM_OF_CONCENTRATE_PUMPS ) { @@ -681,6 +682,28 @@ /*********************************************************************//** * @brief + * The IsConcentratePumpDosingCompleted function gets the concentrate pump + * dosing completion status. + * @details \b Inputs: execState + * @details \b Outputs: none + * @return true when dosing completed,otherwise false. + *************************************************************************/ +BOOL IsConcentratePumpDosingCompleted( void ) +{ + BOOL result = FALSE; + + // Check doisng completed status + if ( ( concentratePumps[D11_PUMP].execState == CONCENTRATE_PUMP_OFF_STATE ) && + ( concentratePumps[D10_PUMP].execState == CONCENTRATE_PUMP_OFF_STATE ) ) + { + result = TRUE; + } + + return result; +} + +/*********************************************************************//** + * @brief * The getConcPumpCurrentMeasuredRevolutionCount function gets the concentrate pump * current measured revolution count. * @details \b Inputs: pumpMesauredRevCnt @@ -869,7 +892,8 @@ } //Stop the pump if measured rev count reaches zero - if ( FALSE == concentratePumps[ pumpId ].hasTurnOnPumpsBeenRequested ) + if ( ( FALSE == concentratePumps[ pumpId ].hasTurnOnPumpsBeenRequested ) || + ( ZERO_REVOLUTION_COUNT == getConcPumpCurrentMeasuredRevolutionCount( pumpId ) ) ) { state = CONCENTRATE_PUMP_OFF_STATE; stopConcentratePump( pumpId ); @@ -909,7 +933,8 @@ } //Stop the pump if measured rev count reaches zero - if ( FALSE == concentratePumps[ pumpId ].hasTurnOnPumpsBeenRequested ) + if ( ( FALSE == concentratePumps[ pumpId ].hasTurnOnPumpsBeenRequested ) || + ( ZERO_REVOLUTION_COUNT == getConcPumpCurrentMeasuredRevolutionCount( pumpId ) ) ) { state = CONCENTRATE_PUMP_OFF_STATE; stopConcentratePump( pumpId ); Index: firmware/App/Controllers/ConcentratePumps.h =================================================================== diff -u -red39129abdca4ec343369d83494530b23621e052 -rc4ea2fbaae71d7beca3879c0970d488f169ebae4 --- firmware/App/Controllers/ConcentratePumps.h (.../ConcentratePumps.h) (revision ed39129abdca4ec343369d83494530b23621e052) +++ firmware/App/Controllers/ConcentratePumps.h (.../ConcentratePumps.h) (revision c4ea2fbaae71d7beca3879c0970d488f169ebae4) @@ -90,6 +90,7 @@ U16 getConcPumpCurrentMeasuredRevolutionCount( CONCENTRATE_PUMPS_T pumpId ); BOOL handleConcentratePumpParkRequest( void ); BOOL isConcPumpParkInProgress( CONCENTRATE_PUMPS_T pumpId ); +BOOL IsConcentratePumpDosingCompleted( void ); BOOL testConcentratePumpDataPublishIntervalOverride( MESSAGE_T *message ); BOOL testConcentratePumpTargetSpeedOverride( MESSAGE_T *message );