Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rd0536d759cb33f099357033c3429401ff1637d26 -r4ea1d6f81be132a2959ba1d11555102761b5f080 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision d0536d759cb33f099357033c3429401ff1637d26) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 4ea1d6f81be132a2959ba1d11555102761b5f080) @@ -19,6 +19,7 @@ #include "ConcentratePumps.h" #include "FPGA.h" #include "MessageSupport.h" +#include "OperationModes.h" #include "PersistentAlarm.h" #include "SystemCommMessages.h" #include "TaskGeneral.h" @@ -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 ) +{ + 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; + + // pumps should be not ON and DG operation mode is not in filling and fault mode + if ( ( concentratePumps[CONCENTRATEPUMPS_CP1_ACID].execState == CONCENTRATE_PUMP_OFF_STATE ) && + ( concentratePumps[CONCENTRATEPUMPS_CP2_BICARB].execState == CONCENTRATE_PUMP_OFF_STATE ) && + ( DG_MODE_FILL != opMode ) && + ( DG_MODE_FAUL != opMode ) ) + { + // Park concentrate pump + requestConcentratePumpOff( CONCENTRATEPUMPS_CP1_ACID, PARK_CONC_PUMPS ); + requestConcentratePumpOff( CONCENTRATEPUMPS_CP2_BICARB, 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