Index: firmware/App/Controllers/SpentChamberFill.c =================================================================== diff -u -r0a1d4f769464407084d39843244af74911bbdfa5 -ra7014f4b673da08de179efcdf68ac8c854fe5757 --- firmware/App/Controllers/SpentChamberFill.c (.../SpentChamberFill.c) (revision 0a1d4f769464407084d39843244af74911bbdfa5) +++ firmware/App/Controllers/SpentChamberFill.c (.../SpentChamberFill.c) (revision a7014f4b673da08de179efcdf68ac8c854fe5757) @@ -39,7 +39,7 @@ // ********** private definitions ********** #define SPENT_CHAMBER_FILL_DATA_PUBLISH_INTERVAL ( 250 / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the balancing chamber data published. -#define SPENT_CHAMBER_SWITCHING_PERIOD 59 ///< Spent Chamber Fill Switching Period +#define SPENT_CHAMBER_SWITCHING_PERIOD 59 ///< Spent Chamber Fill Switching Period to max dialysate flow rate (Qd: 600) to stabilize the valve closure // ********** private data ********** @@ -97,7 +97,7 @@ { initSpentChamberFill(); updateBalChamberSwitchingPeriod(); - // Follow the same cycle for spent chamber fill + // Update the Switching Period to max dialysate flow rate(Qd: 600) for filling spent chamber at max rate. spentChamberFillSwitchingPeriod = SPENT_CHAMBER_SWITCHING_PERIOD; } @@ -287,6 +287,7 @@ static SPENT_CHAMBER_FILL_EXEC_STATE_T handleSpentChamberState1DosingControl( void ) { SPENT_CHAMBER_FILL_EXEC_STATE_T state = SPENT_CHAMBER_FILL_STATE1_DOSING_CNTRL; + // On dosing completion, transition to next state if ( ( TRUE == isConcentratePumpDosingCompleted( D11_PUMP ) ) && ( TRUE == isConcentratePumpDosingCompleted( D10_PUMP ) ) ) Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -r0a1d4f769464407084d39843244af74911bbdfa5 -ra7014f4b673da08de179efcdf68ac8c854fe5757 --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 0a1d4f769464407084d39843244af74911bbdfa5) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision a7014f4b673da08de179efcdf68ac8c854fe5757) @@ -61,7 +61,6 @@ #define ZERO_DIAL_FLOW_RATE 0.0F ///< Zero dialysate flow rate #define SPENT_CHAMBER_FILL_MAX_COUNT 12 ///< 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). @@ -100,6 +99,7 @@ static U32 d48PumpSpeed; ///< Initial D48 pump speed based on the Qd. static U32 scFillWaitStart; ///< totalSpentChamberFill count latched when level first went HIGH. static BOOL scFillWaitActive ; ///< TRUE while waiting out the confirm cycles after level HIGH. + // ********** private function prototypes ********** static void setModeGenDStateTransition( DD_GEND_MODE_STATE_T state ); @@ -771,7 +771,7 @@ if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_SPENT_CHAMBER_H_FILL ) == TRUE ) { - if ( ( TRUE == pendingSpentChamberFill ) ) + if ( TRUE == pendingSpentChamberFill ) { // Deactivate Balancing Chamber Switching requestBalChamberSwitching( FALSE ); @@ -893,6 +893,7 @@ isDialDeliveryInProgress.data = FALSE; state = DD_GEND_DIALYSATE_BYPASS_STATE; scFillWaitActive = FALSE; + totalSpentChamberFill = 0; //Trigger alarm if count exceeded if ( totalSpentChamberFill >= SPENT_CHAMBER_FILL_MAX_COUNT )