Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -rc230be1bd4296324bf5dfc288c212eb7c2ce5d2d -r2cc816226fc1be6c82aecbb3eee0408dafe559b5 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision c230be1bd4296324bf5dfc288c212eb7c2ce5d2d) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 2cc816226fc1be6c82aecbb3eee0408dafe559b5) @@ -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. @@ -847,7 +875,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 ); @@ -1063,6 +1091,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 ) );