Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rd60790939c496145d0c61f9698613bc729bebfed -r0dc0ea11f55be52283cbe40020d097ade139bc57 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision d60790939c496145d0c61f9698613bc729bebfed) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 0dc0ea11f55be52283cbe40020d097ade139bc57) @@ -118,6 +118,7 @@ F32 pulseWidthUS; ///< Concentrate pump pulse width in microseconds. OVERRIDE_U32_T parked; ///< Concentrate pump is currently parked (T/F). OVERRIDE_U32_T parkFaulted; ///< Concentrate pump park command has faulted (T/F). + BOOL isConcPumpParkInProgress; ///< Concentrate pump park progress boolean flag (T/F). } CONCENTRATE_PUMP_T; // ********** private data ********** @@ -156,8 +157,8 @@ { CONCENTRATE_PUMPS_T pumpId; - concentratePumpMonitorTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; - acidConcentratePumpParkPersistenceClear = FALSE; ///< Boolean acid park persistence clearing. + concentratePumpMonitorTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; + acidConcentratePumpParkPersistenceClear = FALSE; bicarbConcentratePumpParkPersistenceClear = FALSE; for ( pumpId = CONCENTRATEPUMPS_CP1_ACID; pumpId < NUM_OF_CONCENTRATE_PUMPS; pumpId++ ) @@ -172,6 +173,7 @@ concentratePumps[ pumpId ].pumpTargetSpeed = 0.0F; concentratePumps[ pumpId ].direction = CONCENTRATE_PUMP_FORWARD_DIR; // For V3 concentratePumps[ pumpId ].controlSet = CONCENTRATE_PUMP_CONTROL_FORWARD; // For DVT + concentratePumps[ pumpId ].isConcPumpParkInProgress = FALSE; stopConcentratePump( pumpId ); } @@ -211,6 +213,16 @@ concentratePumps[ CONCENTRATEPUMPS_CP1_ACID ].parkFaulted.data = (U32)getFPGAAcidPumpParkFault(); concentratePumps[ CONCENTRATEPUMPS_CP2_BICARB ].parkFaulted.data = (U32)getFPGABicarbPumpParkFault(); + if ( ( TRUE == getConcPumpIsParked( CONCENTRATEPUMPS_CP1_ACID ) ) || ( TRUE == getConcPumpParkIsFaulted( CONCENTRATEPUMPS_CP1_ACID ) ) ) + { + // If the pump has parked or faulted during the park, then it is not in progress + concentratePumps[ CONCENTRATEPUMPS_CP1_ACID ].isConcPumpParkInProgress = FALSE; + } + if ( ( TRUE == getConcPumpIsParked( CONCENTRATEPUMPS_CP2_BICARB ) ) || ( TRUE == getConcPumpParkIsFaulted( CONCENTRATEPUMPS_CP2_BICARB ) ) ) + { + concentratePumps[ CONCENTRATEPUMPS_CP2_BICARB ].isConcPumpParkInProgress = FALSE; + } + // Don't monitor persistence for cp speed alarms if we parked. if ( TRUE == acidConcentratePumpParkPersistenceClear ) { @@ -417,6 +429,31 @@ /*********************************************************************//** * @brief + * The isConcPumpParkInProgress function requests whether the concentrate + * pump park is in progress or not. + * @details Inputs: concentratePumps + * @details Outputs: none + * @param pumpId concentrate pump id + * @return TRUE if the concentrate pump park is in progress otherwise, FALSE + *************************************************************************/ +BOOL isConcPumpParkInProgress( CONCENTRATE_PUMPS_T pumpId ) +{ + BOOL status = FALSE; + + if ( pumpId < NUM_OF_CONCENTRATE_PUMPS ) + { + status = concentratePumps[ pumpId ].isConcPumpParkInProgress; + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_CONCENTRATE_PUMP_INVALID_PUMP_ID, pumpId ); + } + + return status; +} + +/*********************************************************************//** + * @brief * The requestConcentratePumpOff function requests the module to turn off * the concentrate pumps. * @details Inputs: none