Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r1e0b16e5778ecf2870fcb65a8b9b9b27d09f70ae -rebb9ab624960bcd1c09b6fc8def4654bb6f0cc3b --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 1e0b16e5778ecf2870fcb65a8b9b9b27d09f70ae) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision ebb9ab624960bcd1c09b6fc8def4654bb6f0cc3b) @@ -8,7 +8,7 @@ * @file ModeFill.c * * @author (last) Dara Navaei -* @date (last) 21-Mar-2023 +* @date (last) 28-Mar-2023 * * @author (original) Leonardo Baloa * @date (original) 19-Nov-2019 @@ -139,6 +139,9 @@ static U32 pumpSpeedIndex; ///< Index used to access the desired pump speed in roPumpFlushBubblesSpeed table. static BOOL havePauseActuatorsBeenSet; ///< Flag to indicate the actuators have been set to pause for the first time. +// NOTE: This variable should be initialized here because the init function is called every time and then this variable is set to FALSE even if the settings from the +// UI wants the RO only mode. +static BOOL hasROOnlyModeBeenEnabled = FALSE; ///< Flag to indicate the RO only mode has been set or not. static OVERRIDE_F32_T usedAcidVolumeML = { 0.0, 0.0, 0.0, 0.0 }; ///< The integrated acid concentration volume has been used in mL. static OVERRIDE_F32_T usedBicarbVolumeML = { 0.0, 0.0, 0.0, 0.0 }; ///< The integrated bicarb concentration volume has been used in mL. static OVERRIDE_U32_T fillModeDataPublishInterval = { FILL_MODE_DATA_PUB_INTERVAL, @@ -166,10 +169,7 @@ * @brief * The initFillMode function initializes the fill mode module. * @details Inputs: none - * @details Outputs: fillState, dialysateFillStartTime, reservoirBaseWeight, - * totalROFlowRateMLPM, concentrateTestStartTime, acidConductivityTotal, - * bicarbConductivityTotal, conductivitySampleCount, havePauseActuatorsBeenSet - * concentratePumpPrimeCount + * @details Outputs: fill mode variables initialized. * @return none *************************************************************************/ void initFillMode( void ) @@ -439,6 +439,7 @@ * @details Inputs: none * @details Outputs: none * @param flag to TRUE if prime is needed otherwise FALSE + * @return none *************************************************************************/ void setThisFisrtFillFlag( BOOL flag ) { @@ -447,6 +448,33 @@ /*********************************************************************//** * @brief + * The enableROOnlyMode function sets the boolean flag that indicates RO + * only mode has been enabled. + * @details Inputs: none + * @details Outputs: hasROOnlyModeBeenEnabled + * @param enableROOnlyMode TRUE if the RO only mode is requested otherwise, FALSE + * @return none + *************************************************************************/ +void setROMode( BOOL enableROOnlyMode ) +{ + hasROOnlyModeBeenEnabled = enableROOnlyMode; +} + +/*********************************************************************//** + * @brief + * The isROOnlyModeEnabled function returns the status of RO only mode. + * @details Inputs: none + * @details Outputs: none + * @return hasROOnlyModeBeenEnabled, TRUE if the RO only mode has been set + * otherwise, FALSE + *************************************************************************/ +BOOL isROOnlyModeEnabled( void ) +{ + return hasROOnlyModeBeenEnabled; +} + +/*********************************************************************//** + * @brief * The handleTestInletWaterState function tests for inlet water quality * and if this is the first fill of a treatment, prime the acid and bicarb * lines before jumping to dialysate production state. @@ -848,7 +876,7 @@ // Fault alarm per PRS 483 SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_OUTLET_PRIMARY_CONDUCTIVITY_OUT_OF_RANGE, avgCPo, MAX_CPO_CONDUCTIVITY_ALLOW ); } - if ( avgRR > MAX_RO_REJECTION_RATIO_ALLOW ) + if ( ( avgRR > MAX_RO_REJECTION_RATIO_ALLOW ) && ( isROOnlyModeEnabled() != TRUE ) ) { // Fault alarm per PRS 483 SET_ALARM_WITH_2_F32_DATA( ALARM_ID_RO_REJECTION_RATIO_OUT_OF_RANGE, avgRR, MAX_RO_REJECTION_RATIO_ALLOW ); @@ -1064,6 +1092,7 @@ fillModeData.usedAcidVolumeML = getChemicalUsedVolumeML( ACID ); fillModeData.usedBicarbVolumeML = getChemicalUsedVolumeML( BICARB ); fillModeData.integratedVolumeML = getIntegratedVolumeML(); + fillModeData.roOnlyModeStatus = (U32)isROOnlyModeEnabled(); broadcastData( MSG_ID_DG_FILL_MODE_DATA, COMM_BUFFER_OUT_CAN_DG_BROADCAST, (U08*)&fillModeData, sizeof( DG_FILL_MODE_DATA_T ) );