Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rb0da135bc589efaf8ad6f3c8c1988dcb672f3ca0 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision b0da135bc589efaf8ad6f3c8c1988dcb672f3ca0) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -106,7 +106,7 @@ static BOOL isBalChamberSwitchingOffRequested; ///< Flag indicating that a request was made to deactivate balancing chamber switching. //TODO: remove later once level sensor working -static U32 bicarbChamberPeriodicFillCounter; +static U32 bicarbChamberPeriodicFillCounter; // ********** private function prototypes ********** @@ -557,7 +557,7 @@ freshDialPressure = getFilteredPressure( D18_PRES ); spentDialPressure = getFilteredPressure( D51_PRES ); - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) == TRUE ) + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) ) { //Set Trimmer heater Target temp every BC cycle to catch up fresh dialysate temp setHeaterTargetTemperature( D45_HEAT, getFilteredTemperatureValue( D4_TEMP ) ); @@ -704,20 +704,22 @@ // Check both spent and fresh side fill is complete isBothFillsComplete = ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ); - isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ); + isFirstCycleNotDone = ( ( FALSE == isFirstCycleBCSwitchingCompleted ) && ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) && ( TRUE == getBalChamberSwitchingOnlyStatus() ) ); if ( FALSE == getBalChamberSwitchingOnlyStatus() ) { isFillCompleteOrFirstCycle = isBothFillsComplete || isFirstCycleNotDone; } - if ( ( TRUE == isFillCompleteOrFirstCycle ) || - ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) && ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) ) + if ( TRUE == isFillCompleteOrFirstCycle ) { // close the state 1 opened valves valveControlForBCState1FillEnd(); isBalChamberFillInProgress = FALSE; - setDialysatePumpTargetRPM( D48_PUMP, getD48PumpSpeedForBCFill(), TRUE ); + if ( FALSE == getBalChamberSwitchingOnlyStatus() ) + { + setDialysatePumpTargetRPM( D48_PUMP, getD48PumpSpeedForBCFill(), TRUE ); + } // Transition to next state state = BAL_CHAMBER_STATE1_FILL_END; @@ -859,10 +861,11 @@ acidVolume = getF32OverrideValue( &acidDoseVolume ); bicarbVolume = getF32OverrideValue( &bicarbDoseVolume ); } + freshDialPressure = getFilteredPressure( D18_PRES ); spentDialPressure = getFilteredPressure( D51_PRES ); - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) == TRUE ) + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) ) { //Set Trimmer heater Target temp every BC cycle to catch up fresh dialysate temp setHeaterTargetTemperature( D45_HEAT, getFilteredTemperatureValue( D4_TEMP ) ); @@ -952,20 +955,22 @@ // Check switching cycle time or pressure check for valve closure isBothFillsComplete = ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ); - isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ); + isFirstCycleNotDone = ( ( FALSE == isFirstCycleBCSwitchingCompleted ) && ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) && ( TRUE == getBalChamberSwitchingOnlyStatus() ) ); if ( FALSE == getBalChamberSwitchingOnlyStatus() ) { isFillCompleteOrFirstCycle = isBothFillsComplete || isFirstCycleNotDone; } - if ( ( TRUE == isFillCompleteOrFirstCycle ) || - ( ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ) && ( TRUE == getBalChamberSwitchingOnlyStatus() ) ) ) + if ( TRUE == isFillCompleteOrFirstCycle ) { // close the valves valveControlForBCState2FillEnd(); isBalChamberFillInProgress = FALSE; - setDialysatePumpTargetRPM( D48_PUMP, getD48PumpSpeedForBCFill(), TRUE ); + if ( FALSE == getBalChamberSwitchingOnlyStatus() ) + { + setDialysatePumpTargetRPM( D48_PUMP, getD48PumpSpeedForBCFill(), TRUE ); + } //Transition to next state state = BAL_CHAMBER_STATE2_FILL_END; @@ -1116,7 +1121,7 @@ // Check if a request made was to activate the balancing chamber switching. if ( TRUE == isBalChamberSwitchingOnRequested ) { - //Clear the request flag to indicate that the request was processed. + //Clear request was processed. isBalChamberSwitchingOnRequested = FALSE; // Set flag to indicate that balancing chamber switching is active @@ -1277,6 +1282,7 @@ d48SpeedPostRangeCheck = RANGE( spentDialPumpSpeed, minD48Speed, maxD48Speed ); + // Do not turn on the pump if the switching only is enabled in the standby mode. if ( FALSE == getBalChamberSwitchingOnlyStatus() ) { Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -rb0da135bc589efaf8ad6f3c8c1988dcb672f3ca0 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision b0da135bc589efaf8ad6f3c8c1988dcb672f3ca0) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -45,14 +45,18 @@ #define DRY_BICART_DATA_PUBLISH_INTERVAL ( 250 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the balancing chamber data published. // Dry Bicart Fill -#define DRY_BICART_FILL_DURATION_MIN_MS ( 2 * MS_PER_SECOND ) ///< Minimum fill duration to be met to end the fill cycle. +#define DRY_BICART_FILL_PERSISTANCE_DURATION_MS 200 ///< Fill persistence duration to overcome the pressure over shoot for beta 1.9 and beta 2.0. +#define DRY_BICART_FILL_DURATION_MIN_MS ( ( 2 * MS_PER_SECOND ) + \ + DRY_BICART_FILL_PERSISTANCE_DURATION_MS ) ///< Minimum fill duration to be met to end the fill cycle. #define DRY_BICART_FILL_COMPLETE_TIME_MS ( 1 * MS_PER_SECOND ) ///< Wait time to reset the request flag after fill complete #define DRY_BICART_FILL_DURATION_DIFF_MS 750 ///< Fill duration difference between last and current fill cycle. -#define PRESSURE_OFFSET 2 ///< Dry bicart pressure offset -#define DRY_BICART_FILL_COMPLETE_PRESSURE ( 10.0F + PRESSURE_OFFSET ) ///< Maximum pressure reached to indicate the dry bicart fill being completed. -#define DRY_BICART_FILL_INITIATE_PRESSURE 3.0F ///< Minimum pressure required to initiate the dry bicart fill process. + +#define PRESSURE_OFFSET_PSI 2 ///< Dry bicart pressure offset. +#define DRY_BICART_FILL_COMPLETE_PRESSURE ( 10.0F + PRESSURE_OFFSET_PSI ) ///< Maximum pressure reached to indicate the dry bicart fill being completed. +#define DRY_BICART_FILL_INITIATE_PRESSURE 1.5F ///< Minimum pressure required to initiate the dry bicart fill process. #define DRY_BICART_FILL_COMPLETE_SUPPLY_PRESSURE 6.0F ///< Maximum pressure allowed at bicart fill during supply process/state #define DRY_BICART_FILL_INITIATE_SUPPLY_PRESSURE 3.0F ///< Minimum pressure required to initiate the dry bicart fill during supply process/state +#define MAX_DRY_BICART_FILL_COMPLETE_PRESSURE 15 #define DRY_BICART_DEFAULT_MAX_FILL_CYCLE_CNT 10 ///< Default max fill cycle allowed for dry bicart fill/mix with water. #define DRY_BICART_MAX_FILL_CYCLE_CNT 30 ///< Max fill cycle allowed (by override) for dry bicart fill/mix with water. @@ -80,8 +84,8 @@ #define DRY_BICART_DRAIN_COND_STABLE_SAMPLES 10U ///< Debounce samples (10*50ms=500ms) // drybicarb mixing -#define BICARB_VOL_CONTROL_P_COEFFICIENT 0.00008484 ///< Bicarb proportional gain (kp) -#define BICARB_VOL_CONTROL_I_COEFFICIENT 0.00033936 ///< Bicarb integral gain. (ki) +#define BICARB_VOL_CONTROL_P_COEFFICIENT ( 0.00008484 * 2 ) ///< Bicarb proportional gain (kp) +#define BICARB_VOL_CONTROL_I_COEFFICIENT ( 0.00033936 / 5) ///< Bicarb integral gain. (ki) #define MIN_BICARB_VOLUME_ML 0.868686869 ///< Minimum bicarb volume in mL #define MAX_BICARB_VOLUME_ML 1.8 ///< Maximum bicarb volume in mL @@ -105,9 +109,13 @@ #define MIX_NO_FEED_FORWARD 0.0F ///< Feedforward term for dialysate closed loop control -#define MIXING_CONTROL_INTERVAL_MS ( 15 * MS_PER_SECOND ) ///< Dialysate mixing control interval in ms -#define MIXING_CONTROL_INTERVAL ( MIXING_CONTROL_INTERVAL_MS /\ - TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the dialysate mixing is controlled. +#define MIX_CONTROL_INTERVAL_MS ( 15 * MS_PER_SECOND ) ///< Dialysate dosing control interval in ms +#define BICARB_MIX_CONTROL_INTERVAL ( 3 * MS_PER_SECOND /\ + TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the dialysate mix is controlled. +#define ACID_MIX_CONTROL_INTERVAL ( MIX_CONTROL_INTERVAL_MS /\ + TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the dialysate mix is controlled. +#define BICARB_DEADBAND_CONTROL 50.0F ///< Dry Bicarb dead band control +#define ACID_DEADBAND_CONTROL 100.0F ///< Acid dead band control /// Payload record structure for dry bicart fill request typedef struct @@ -203,7 +211,7 @@ static OVERRIDE_F32_T dryBiCartDialysateTargetConductivity; ///< Acid bicarb mix conductivity static OVERRIDE_F32_T dryBiCartDialysateDeltaConductivity; ///< Acid bicarb delta conductivity -static OVERRIDE_F32_T dryBiCartMixControlInterval; ///< Mix control interval +static OVERRIDE_U32_T dryBiCartMixControlInterval; ///< Mix control interval static PI_CONTROLLER_SIGNALS_DATA bicarbControlSignals; ///< Bicarb closed loop control signal data static PI_CONTROLLER_SIGNALS_DATA acidControlSignals; ///< Acid closed loop control signal data @@ -251,7 +259,7 @@ static F32 getAcidKiGainCoefficient( void ); static F32 getDryBicartLowerCartPressure( void ); static F32 getDryBicartUpperCartPressure( void ); -static F32 getDryBicartMixControlInterval( void ); +static U32 getDryBicartMixControlInterval( void ); // publish the status static void publishDryBicartData( void ); @@ -370,9 +378,9 @@ dryBiCartLowerCartPressure.ovInitData = 0.0F; dryBiCartLowerCartPressure.override = OVERRIDE_RESET; - dryBiCartMixControlInterval.data = MIXING_CONTROL_INTERVAL; - dryBiCartMixControlInterval.ovData = MIXING_CONTROL_INTERVAL; - dryBiCartMixControlInterval.ovInitData = 0.0F; + dryBiCartMixControlInterval.data = BICARB_MIX_CONTROL_INTERVAL; + dryBiCartMixControlInterval.ovData = BICARB_MIX_CONTROL_INTERVAL; + dryBiCartMixControlInterval.ovInitData = 0; dryBiCartMixControlInterval.override = OVERRIDE_RESET; dryBiCartFillStartTime = 0; @@ -503,6 +511,7 @@ break; } + (void)dryBicartSubstate; // Publish dry bicart data publishDryBicartData(); } @@ -1002,9 +1011,9 @@ * @details \b Outputs: none * @return TRUE if successful, FALSE if not. *************************************************************************/ -static F32 getDryBicartMixControlInterval( void ) +static U32 getDryBicartMixControlInterval( void ) { - F32 result = getF32OverrideValue( &dryBiCartMixControlInterval ); + U32 result = getU32OverrideValue( &dryBiCartMixControlInterval ); return result; } @@ -1088,38 +1097,51 @@ { DIALYSATE_MIXING_STATE_T state = DIALYSATE_MIXING_CONTROL_TO_TARGET_STATE; - // control at set minimum interval or interval is expired and balance chamber fill is complete - if ( ( ++dialysateMix[ mixId ].controlTimerCounter >= getDryBicartMixControlInterval() ) ) + if ( BICARB_MIX_ID == mixId ) { - dialysateMix[ mixId ].controlTimerCounter = 0; - - // Control based on the measured and target conductivity - if ( BICARB_MIX_ID == mixId ) + // control interval for bicarb + if ( ( ++dialysateMix[ mixId ].controlTimerCounter >= getDryBicartMixControlInterval() ) ) { + dialysateMix[ mixId ].controlTimerCounter = 0; + + // Control based on the measured and target conductivity PI_CONTROLLER_SIGNALS_DATA debugBicarbControl; F32 measuredBicarbConductivity; measuredBicarbConductivity = getFilteredConductivity( D17_COND ); + F32 bicarbMixVol = runPIController( PI_CONTROLLER_ID_BICARB_VOL, getBicarbTargetConductivity(), measuredBicarbConductivity ); - //Set bicarb dosing vol - setBicarbMixVol( bicarbMixVol ); + if ( fabs ( getBicarbTargetConductivity() - measuredBicarbConductivity ) > BICARB_DEADBAND_CONTROL ) + { + //Set bicarb mix vol only if its above dead band threshold, else use the previous set vlaue + setBicarbMixVol( bicarbMixVol ); + } + debugBicarbControl = getDebugPIControllerSignals( PI_CONTROLLER_ID_BICARB_VOL ); memcpy( (void*)&bicarbControlSignals, (void*)&debugBicarbControl, sizeof(PI_CONTROLLER_SIGNALS_DATA) ); } - // ACID Mix - else if ( ACID_MIX_ID == mixId ) + } + + if ( ACID_MIX_ID == mixId ) + { + // control interval for acid + if ( ( ++dialysateMix[ mixId ].controlTimerCounter >= ACID_MIX_CONTROL_INTERVAL ) ) { - F32 measuredAcidBicarbMixConductivity; + dialysateMix[ mixId ].controlTimerCounter = 0; + + F32 measuredAcidBicarbMixConductivity = getFilteredConductivity( D27_COND ); PI_CONTROLLER_SIGNALS_DATA debugAcidControl; - measuredAcidBicarbMixConductivity = getFilteredConductivity( D27_COND ); - F32 acidMixVol = runPIController( PI_CONTROLLER_ID_ACID_VOL, getAcidBicarbTargetConductivity(), measuredAcidBicarbMixConductivity ); - //Set acid dosing vol - setAcidMixVol( acidMixVol ); + if ( fabs ( getAcidBicarbTargetConductivity() - measuredAcidBicarbMixConductivity ) > ACID_DEADBAND_CONTROL ) + { + // set acid mix volume if its above dead band threshold , else use previous set value + setAcidMixVol( acidMixVol ); + } + debugAcidControl = getDebugPIControllerSignals( PI_CONTROLLER_ID_ACID_VOL ); memcpy( (void*)&acidControlSignals, (void*)&debugAcidControl, sizeof(PI_CONTROLLER_SIGNALS_DATA) ); @@ -1235,12 +1257,30 @@ // Close dry bicart inlet water if bicart is filled with water if ( d66Pressure >= DRY_BICART_FILL_COMPLETE_PRESSURE ) { - setValveState( D65_VALV, VALVE_STATE_CLOSED ); - lastFillDurationInMS = currentFillDurationInMS; - currentFillDurationInMS = calcTimeSince( dryBiCartFillStartTime ); - //Increment number of fill cycle - biCartFillCycleCounter++; - state = DRY_BICART_DEGAS_START_STATE; + // to check the the maximum cart pressure during persistence on D66 + if ( d66Pressure >= MAX_DRY_BICART_FILL_COMPLETE_PRESSURE ) + { + setValveState( D65_VALV, VALVE_STATE_CLOSED ); + + lastFillDurationInMS = currentFillDurationInMS; + currentFillDurationInMS = calcTimeSince( dryBiCartFillStartTime ); + //Increment number of fill cycle + biCartFillCycleCounter++; + + state = DRY_BICART_DEGAS_START_STATE; + } + // 200 ms persistence on D66 pressure since pressure overshoot just after D65 opening + if ( TRUE == didTimeout( dryBiCartFillStartTime, DRY_BICART_FILL_PERSISTANCE_DURATION_MS ) ) + { + setValveState( D65_VALV, VALVE_STATE_CLOSED ); + + lastFillDurationInMS = currentFillDurationInMS; + currentFillDurationInMS = calcTimeSince( dryBiCartFillStartTime ); + //Increment number of fill cycle + biCartFillCycleCounter++; + + state = DRY_BICART_DEGAS_START_STATE; + } } //TODO:Handle timeout alarm for opening D65 valve too long @@ -1439,6 +1479,7 @@ // open inlet water to bicart setValveState( D65_VALV, VALVE_STATE_OPEN ); + //setValveState( D3_VALV, VALVE_STATE_OPEN ); return state; } @@ -1550,6 +1591,7 @@ setValveState( D80_VALV, VALVE_STATE_CLOSED ); dryBiCarbSypplyVentStartTime = getMSTimerCount(); + setValveState( D64_VALV, VALVE_STATE_CLOSED ); state = BICARB_SUPPLY_VENT_START_STATE; } /*else if ( d66Pressure <= getDryBicartLowerCartPressure() ) @@ -2217,4 +2259,21 @@ return result; } +/*********************************************************************//** + * @brief + * The testDryBiCartMixControlIntervalOverride function sets the override value + * of mix control interval + * @details Inputs: dryBiCartMixControlInterval + * @details Outputs: dryBiCartMixControlInterval + * @param message Override message from Dialin which includes the override + * value to override the bicart lower pressure. + * @return TRUE if override successful, FALSE if not + *************************************************************************/ +BOOL testDryBiCartMixControlIntervalOverride( MESSAGE_T *message ) +{ + BOOL result = u32Override( message, &dryBiCartMixControlInterval, 0, BICARB_MIX_CONTROL_INTERVAL ); + + return result; +} + /**@}*/ Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -rb0da135bc589efaf8ad6f3c8c1988dcb672f3ca0 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision b0da135bc589efaf8ad6f3c8c1988dcb672f3ca0) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -79,6 +79,7 @@ #define D5_HEATER_PWM_ADJ_SLOPE_FACTOR 0.00005F ///< AC heater close loop PWM adjustment slope factor #define D5_HEATER_PWM_INTERCEPT_FACTOR 0.0055F ///< AC heater close loop PWM adjustment intercept factor +//#define D5_HEAT_CONTROL_INTERVAL_MS 30000 /// Primary heater control interval in milli seconds #define D5_HEAT_CONTROL_INTERVAL_MS 3000 /// Primary heater control interval in milli seconds #define D5_HEAT_CONTROL_INTERVAL_COUNT ( D5_HEAT_CONTROL_INTERVAL_MS / TASK_GENERAL_INTERVAL ) ///< Primary heater control interval count. #define D45_HEAT_CONTROL_INTERVAL_MS ( 3 * MS_PER_SECOND ) ///< Trimmer heater control interval in milli seconds @@ -527,7 +528,7 @@ } else { - measuredTempAtDialyzer = getConductivityTemperature( D27_COND ); + measuredTempAtDialyzer = getFilteredConductivitySensorTemperature( D27_COND ); } F32 calcTargetTemp = getHeaterTargetTemperature( D5_HEAT ); Index: firmware/App/DDCommon.h =================================================================== diff -u -r37d6f3341f62349589f63975779c0df952c0cfd4 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/DDCommon.h (.../DDCommon.h) (revision 37d6f3341f62349589f63975779c0df952c0cfd4) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -25,6 +25,7 @@ #define DD_VERSION_MAJOR 0 #define DD_VERSION_MINOR 0 #define DD_VERSION_MICRO 0 +#define DD_VERSION_BUILD 125 #define DD_VERSION_BUILD 77 // ********** development build switches ********** @@ -48,6 +49,9 @@ //Uncomment below for bicarb chamber filling //#define __BICARB_CHAMBER_FILL__ 1 +//UnComment below for DryBicarb testing +//#define __DRY_BICARB__ 1 + //Uncomment below to disable heaters debug message #define __HEATERS_DEBUG__ 1 @@ -56,7 +60,6 @@ // comment below to disable bicarb multi level sensor for time based chamber F fill #define CONDUCTIVE_LEVEL_SENSOR_ENABLED 1 - #include #include #endif Index: firmware/App/Modes/FPModes/ModePreGenPermeate.c =================================================================== diff -u -r7aa0c684cca238a9697867ff72e5c3f5f2edb379 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/Modes/FPModes/ModePreGenPermeate.c (.../ModePreGenPermeate.c) (revision 7aa0c684cca238a9697867ff72e5c3f5f2edb379) +++ firmware/App/Modes/FPModes/ModePreGenPermeate.c (.../ModePreGenPermeate.c) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -203,7 +203,6 @@ { setBoostPumpTargetPressure( VERIFY_WATER_BOOST_PUMP_TGT_PSI ); } - //TODO change target flow to 750 + rinse pump rate setROPumpTargetFlowRateMLPM( VERIFY_WATER_RO_PUMP_TGT_FLOW_ML, TRUE ); verifyWaterTimer = getMSTimerCount(); break; Index: firmware/App/Modes/FPModes/StateFlushPermeate.c =================================================================== diff -u -rb0da135bc589efaf8ad6f3c8c1988dcb672f3ca0 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/Modes/FPModes/StateFlushPermeate.c (.../StateFlushPermeate.c) (revision b0da135bc589efaf8ad6f3c8c1988dcb672f3ca0) +++ firmware/App/Modes/FPModes/StateFlushPermeate.c (.../StateFlushPermeate.c) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -262,7 +262,6 @@ { setBoostPumpTargetPressure( PERMEATE_FLUSH_BOOST_PUMP_TGT_PSI ); } - //TODO update target macro after changing it to 750 + rinse pump rate setROPumpTargetFlowRateMLPM( PERMEATE_FLUSH_RO_PUMP_TGT_ML, TRUE ); permeateFlushTimer = getMSTimerCount(); permeateFlushAlarmTimer = getMSTimerCount(); Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -r7aa0c684cca238a9697867ff72e5c3f5f2edb379 -r7d7129ebe8a98694bea7cf4118f3bedf62f2157b --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 7aa0c684cca238a9697867ff72e5c3f5f2edb379) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 7d7129ebe8a98694bea7cf4118f3bedf62f2157b) @@ -60,11 +60,11 @@ #define ZERO_DIAL_FLOW_RATE 0.0F ///< Zero dialysate flow rate #define SPENT_CHAMBER_FILL_MAX_COUNT 10 ///< Total number of spent chamber fill allowed. #define BICARB_CHAMBER_FILL_TIMEOUT ( 1 * MS_PER_SECOND ) ///< Bicarb chamber fill timeout. - #define PUMP_SPEED_SLOPE_FACTOR_DIENER_2000 1.24F ///< D48 Diener 2000 pump speed slope (y = 1.24x + 30). #define PUMP_SPEED_INTERCEPT_FACTOR_DIENER_2000 30.0F ///< D48 Diener 2000 pump speed intercept. #define PUMP_SPEED_SLOPE_FACTOR_DIENER_1000 2.869F ///< D48 Diener 1000 pump speed slope (y = 2.869x + 25.956). #define PUMP_SPEED_INTERCEPT_FACTOR_DIENER_1000 25.956F ///< D48 Diener 1000 pump speed intercept. + #define BICARB_CHAMBER_FILL_TIMEOUT ( 1 * MS_PER_SECOND ) ///< Bicarb chamber fill timeout. //Testing @@ -269,7 +269,7 @@ startHeater( D5_HEAT ); //Turn on Trimmer heater - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) == TRUE ) + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) ) { setHeaterTargetTemperature( D45_HEAT, getFilteredTemperatureValue( D4_TEMP ) ); } @@ -318,7 +318,7 @@ startHeater( D5_HEAT ); //Turn on Trimmer heater - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) == TRUE ) + if ( TRUE == getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) ) { setHeaterTargetTemperature( D45_HEAT, getFilteredTemperatureValue( D4_TEMP ) ); }