Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rd0536d759cb33f099357033c3429401ff1637d26 -r09ac8a11080a42d32c9a217d267fc16c9f397cc2 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision d0536d759cb33f099357033c3429401ff1637d26) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 09ac8a11080a42d32c9a217d267fc16c9f397cc2) @@ -23,6 +23,7 @@ #include "SystemCommMessages.h" #include "TaskGeneral.h" #include "Utilities.h" +#include "OperationModes.h" /** * @addtogroup ConcentratePumps @@ -389,6 +390,47 @@ /*********************************************************************//** * @brief + * The handleConcentratePumpParkRequest function accepts/rejects the park + * concentrate pumps request. + * @details Inputs: Pump state and DG operating mode + * @details Outputs: command response set to true if able to perform parking pump. + * @return result as true if park is accomplished. + *************************************************************************/ +BOOL handleConcentratePumpParkRequest( void ) +{ + CONCENTRATE_PUMPS_T pumpId; + DG_CMD_RESPONSE_T cmdResponse; + BOOL result = FALSE; + DG_OP_MODE_T opMode = getCurrentOperationMode(); + cmdResponse.commandID = DG_CMD_PARK_CONCENTRATE_PUMPS; + cmdResponse.rejected = FALSE; + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; + + + for ( pumpId = CONCENTRATEPUMPS_CP1_ACID; pumpId < NUM_OF_CONCENTRATE_PUMPS; pumpId++ ) + { + // check if pump is not ON and DG mode is not in filling or fault mode, then park the concentrate pumps + if ( ( concentratePumps[ pumpId ].execState == CONCENTRATE_PUMP_OFF_STATE ) && ( ( DG_MODE_FILL != opMode ) || ( DG_MODE_FAUL != opMode ) ) ) + { + // Park concentrate pump + requestConcentratePumpOff( pumpId, PARK_CONC_PUMPS ); + result |= TRUE; + } + else + { + cmdResponse.rejected = TRUE; + cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_INVALID_MODE; + result |= FALSE; + } + } + + sendCommandResponseMsg( &cmdResponse ); + + return result; +} + +/*********************************************************************//** + * @brief * The requestConcentratePumpOff function requests the module to turn off * the concentrate pumps. * @details Inputs: none