Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -r60834a8b3bf8348515a367ba635aa8ad63ea7f22 -r0c599603188536e9d329fbd60a8768affd0c49a2 --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 60834a8b3bf8348515a367ba635aa8ad63ea7f22) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 0c599603188536e9d329fbd60a8768affd0c49a2) @@ -100,7 +100,6 @@ BOOL fillAvgConductivityOutOfRange; ///< Fill average conductivity out of range. BOOL fillEmtyAcidBottleDetected; ///< Fill acid bottle empty detected. BOOL fillEmtyBicarbBottleDetected; ///< Fill bicarb bottle empty detected. - BOOL fillBottlesNeedPrimeFlag; ///< Fill flag to indicate acid and bicarb bottle need priming. } FILL_CONDITION_STATUS_T; /// DG broadcast dialysate fill data structure. @@ -383,7 +382,6 @@ fillStatus.fillAvgConductivityOutOfRange = FALSE; fillStatus.fillEmtyAcidBottleDetected = FALSE; fillStatus.fillEmtyBicarbBottleDetected = FALSE; - fillStatus.fillBottlesNeedPrimeFlag = FALSE; } /*********************************************************************//** @@ -414,26 +412,6 @@ /*********************************************************************//** * @brief - * The isBadFill function returns the boolean flag that indicates - * whether the bad fill is detected at the end of the fill mode. - * @details Inputs: none - * @details Outputs: none - * @return TRUE if bad fill, otherwise FALSE - *************************************************************************/ -BOOL isBadFill( void ) -{ - BOOL badFillFlag = FALSE; - - if ( TRUE == isAvgConductivityOutOfRange() ) - { - badFillFlag = TRUE; - } - - return badFillFlag; -} - -/*********************************************************************//** - * @brief * The isEmptyAcidBottle function returns the boolean flag that indicates * whether the acid bottle is empty. * @details Inputs: none @@ -460,35 +438,19 @@ /*********************************************************************//** * @brief - * The setBottlesNeedPrimeFlag function sets the boolean flag that indicates + * The setThisFisrtFillFlag function sets the boolean flag that indicates * the acid and bicarb bottle need priming. * @details Inputs: none * @details Outputs: none - * @return fillStatus.fillBottlesNeedPrimeFlag * @param flag to TRUE if prime is needed otherwise FALSE *************************************************************************/ -BOOL setBottlesNeedPrimeFlag( BOOL flag ) +void setThisFisrtFillFlag( BOOL flag ) { - fillStatus.fillBottlesNeedPrimeFlag = flag; - - return fillStatus.fillBottlesNeedPrimeFlag; + fillStatus.isThisFirstFill = flag; } /*********************************************************************//** * @brief - * The getBottlesNeedPrimeFlag function gets the boolean flag that indicates - * the acid and bicarb bottle need priming. - * @details Inputs: none - * @details Outputs: none - * @return fillStatus.fillBottlesNeedPrimeFlag - *************************************************************************/ -BOOL getBottlesNeedPrimeFlag( void ) -{ - return fillStatus.fillBottlesNeedPrimeFlag; -} - -/*********************************************************************//** - * @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. @@ -507,7 +469,7 @@ // If this is the first fill of a treatment, prime acid and bicarb lines, otherwise transition // to dialysate production directly #ifndef DISABLE_MIXING - if ( TRUE == isThisTheFirstFill() || TRUE == getBottlesNeedPrimeFlag() ) + if ( TRUE == isThisTheFirstFill() ) { // Prepare the acid and bicarb pumps to prime the concentrate lines setROPumpTargetFlowRateLPM( RO_PUMP_800_ML_PER_MIN / MILLILITERS_PER_LITER, TARGET_RO_PRESSURE_PSI ); @@ -839,20 +801,18 @@ { fillStatus.fillAvgConductivityOutOfRange = TRUE; // flag to signal idle mode to handle bad fill fillStatus.isThisFirstFill = TRUE; - setBottlesNeedPrimeFlag( TRUE ); - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_REPLACE_CONCENTRATE_BOTTLES, avgBicarbConductivity, BICARB_NORMAL_CONDUCTIVITY ); // trigger replace bottles alarm #1 - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_CREATING_DIALYSATE_PLEASE_WAIT, avgBicarbConductivity, BICARB_NORMAL_CONDUCTIVITY ); // immediately trigger wait for dialysate alarm #2 - requestNewOperationMode( DG_MODE_GENE ); // leave fill mode and go to idle + setThisFisrtFillFlag( TRUE ); + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FILL_CONDUCTIVITY_OUT_OF_RANGE, avgBicarbConductivity, BICARB_NORMAL_CONDUCTIVITY ); // trigger replace bottles alarm #1 + activateAlarmNoData ( ALARM_ID_CREATING_DIALYSATE_PLEASE_WAIT ); } if ( TRUE == isValueWithinPercentRange( avgAcidConductivity, ACID_NORMAL_CONDUCTIVITY, FIVE_PERCENT_FACTOR ) ) { fillStatus.fillAvgConductivityOutOfRange = TRUE; // flag to signal idle mode to handle bad fill fillStatus.isThisFirstFill = TRUE; - setBottlesNeedPrimeFlag( TRUE ); - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_REPLACE_CONCENTRATE_BOTTLES, avgAcidConductivity, ACID_NORMAL_CONDUCTIVITY ); // trigger replace bottles alarm #1 then - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_CREATING_DIALYSATE_PLEASE_WAIT, avgAcidConductivity, ACID_NORMAL_CONDUCTIVITY ); // immediately trigger wait for dialysate alarm #2 - requestNewOperationMode( DG_MODE_GENE ); // leave fill mode and go to idle + setThisFisrtFillFlag( TRUE ); + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_FILL_CONDUCTIVITY_OUT_OF_RANGE, avgAcidConductivity, ACID_NORMAL_CONDUCTIVITY ); // trigger replace bottles alarm #1 then + activateAlarmNoData ( ALARM_ID_CREATING_DIALYSATE_PLEASE_WAIT ); } #endif // Done with this fill. Calculate the average fill flow rate and average temperature