Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r1fa38184526c2b0c072eb8745c653f772156a824 -r3b84fc79b2fd6c7a447e54e4fe821447f613af59 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 1fa38184526c2b0c072eb8745c653f772156a824) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 3b84fc79b2fd6c7a447e54e4fe821447f613af59) @@ -7,8 +7,8 @@ * * @file ModeStandby.c * -* @author (last) Sameer Kalliadan Poyil -* @date (last) 24-Feb-2026 +* @author (last) Raghu Kallala +* @date (last) 22-Apr-2026 * * @author (original) Vinayakam Mani * @date (original) 07-Aug-2024 @@ -47,7 +47,6 @@ static DD_STANDBY_MODE_STATE_T standbyState; ///< Currently active standby state. static BOOL pendingStartDDPreGenRequest; ///< Flag indicating TD has requested DD start the pre generation dialysate request. -static BOOL pendingBalanceChamberSwOnlyRequest; ///< Flag indicating balancing chamber switch only request. //static BOOL pendingStartDDFlushRequest; ///< Flag indicating TD has requested DD start flush. //static BOOL pendingStartDDHeatDisinfectRequest; ///< Flag indicating TD has requested DD start heat disinfect. //static BOOL pendingStartDDHeatDisinfectActiveCoolRequest; ///< Flag indicating TD has requested DD start heat disinfect active cool. @@ -69,7 +68,6 @@ { standbyState = DD_STANDBY_MODE_STATE_IDLE; pendingStartDDPreGenRequest = FALSE; - pendingBalanceChamberSwOnlyRequest = FALSE; // pendingStartDDFlushRequest = FALSE; // pendingStartDDHeatDisinfectRequest = FALSE; // pendingStartDDHeatDisinfectActiveCoolRequest = FALSE; @@ -95,6 +93,9 @@ resetPermeateTank(); + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); + // // Upon transition to mode standby set CD1 and CD2 calibration records to be picked to the normal // // table. If the chemical disinfect fails, the mode transitions back to mode standby. // setCondcutivitySensorCalTable( D17_COND, CAL_DATA_CD1_COND_SENSOR ); @@ -168,7 +169,7 @@ if ( TRUE == pendingStartDDPreGenRequest ) { // wait for IOFP GENP mode and when IOFP manual control is not set - if ( ( FP_MODE_GENP == fpMode ) && ( getTestConfigStatus( TEST_CONFIG_DD_RUN_SOLO ) == FALSE ) ) + if ( ( ( FP_MODE_GENP == fpMode ) || ( FP_MODE_DEGP == fpMode ) ) && ( getTestConfigStatus( TEST_CONFIG_DD_RUN_SOLO ) == FALSE ) ) { pendingStartDDPreGenRequest = FALSE; requestNewOperationMode( DD_MODE_PREG ); @@ -179,11 +180,6 @@ requestNewOperationMode( DD_MODE_PREG ); } } - //Test request to handle only balancing chamber switching - else if ( TRUE == pendingBalanceChamberSwOnlyRequest ) - { - execBalancingChamberControl(); - } // else if ( TRUE == pendingStartDDFlushRequest ) // { // pendingStartDDFlushRequest = FALSE; @@ -249,7 +245,7 @@ * The requestBCSwitchingOnlyStart function handles Balancing chamber switching * only start request. * @details \b Inputs: standbyState - * @details \b Outputs: pendingBalanceChamberSwOnlyRequest + * @details \b Outputs: none * @return TRUE if request accepted, FALSE if not. *************************************************************************/ BOOL requestBCSwitchingOnlyStart( void ) @@ -259,7 +255,9 @@ if ( DD_STANDBY_MODE_STATE_IDLE == standbyState ) { result = TRUE; - pendingBalanceChamberSwOnlyRequest = TRUE; + + // Activate Balancing Chamber Switching + requestBalChamberSwitching( TRUE ); } return result; @@ -270,12 +268,14 @@ * The requestBCSwitchingOnlyStop function handles Balancing chamber switching * only stop request. * @details \b Inputs: standbyState - * @details \b Outputs: pendingBalanceChamberSwOnlyRequest + * @details \b Outputs: none * @return none. *************************************************************************/ void requestBCSwitchingOnlyStop( void ) { - pendingBalanceChamberSwOnlyRequest = FALSE; + // Deactivate Balancing Chamber Switching + requestBalChamberSwitching( FALSE ); + // Close all balancing chamber valves valveControlForBCClosedState(); } @@ -479,4 +479,60 @@ *************************************************************************/ +/*********************************************************************//** + * @brief + * The testValidateDDStandbyChangeReq function validate whether request + * operation sub mode is legal or not. + * @details \b Inputs: none + * @details \b Outputs: none + * @param newSubMode the enumerated sub state of the mode + * @return TRUE if request is legal, FALSE if not + *************************************************************************/ +BOOL testValidateDDStandbyChangeReq( U32 newSubMode ) +{ + BOOL result = FALSE; + + if ( newSubMode < NUM_OF_DD_STANDBY_MODE_STATES ) + { + switch ( newSubMode ) + { + case DD_STANDBY_MODE_STATE_IDLE: + result = TRUE; + break; + + case DD_STANDBY_MODE_STATE_PAUSE: + default: + break; + } + } + + return result; +} + +/*********************************************************************//** + * @brief + * The testSignalNewDDStandbySubMode function request transition to a + * new operation sub mode. + * @details \b Inputs: none + * @details \b Outputs: standbyState + * @param newSubMode the enumerated sub state of the mode + * @return none + *************************************************************************/ +void testSignalNewDDStandbySubMode( U32 newSubMode ) +{ + if ( newSubMode < NUM_OF_DD_STANDBY_MODE_STATES ) + { + standbyState = (DD_STANDBY_MODE_STATE_T)newSubMode; + + switch ( newSubMode ) + { + // Any of these state require no special handling + case DD_STANDBY_MODE_STATE_IDLE: + case DD_STANDBY_MODE_STATE_PAUSE: + default: + break; + } + } +} + /**@}*/