Index: firmware/App/Modes/ModeGenDialysate.c =================================================================== diff -u -r3643a2e648ab2b216fd08579e56bdc02fb94836d -r58e5721497be626929b6cdc0c5187e18b34bbaad --- firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 3643a2e648ab2b216fd08579e56bdc02fb94836d) +++ firmware/App/Modes/ModeGenDialysate.c (.../ModeGenDialysate.c) (revision 58e5721497be626929b6cdc0c5187e18b34bbaad) @@ -7,8 +7,8 @@ * * @file ModeGenDialysate.c * -* @author (last) Vinayakam Mani -* @date (last) 14-Nov-2025 +* @author (last) Michael Garthwaite +* @date (last) 29-Jan-2026 * * @author (original) Vinayakam Mani * @date (original) 06-Nov-2024 @@ -608,15 +608,16 @@ execBalancingChamberControl(); } -#ifdef __SPENT_CHAMBER_FILL__ - if ( ( TRUE == pendingSpentChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) + if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_SPENT_CHAMBER_H_FILL ) == TRUE ) { - setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); - pendingSpentChamberFill = FALSE; - isDialDeliveryInProgress.data = FALSE; - state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + if ( ( TRUE == pendingSpentChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) + { + setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); + pendingSpentChamberFill = FALSE; + isDialDeliveryInProgress.data = FALSE; + state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + } } -#endif #ifdef __BICARB_CHAMBER_FILL__ if ( ( TRUE == pendingBicarbChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) { @@ -661,15 +662,16 @@ isDialDeliveryInProgress.data = FALSE; state = DD_GEND_DIALYSATE_BYPASS_STATE; } -#ifdef __SPENT_CHAMBER_FILL__ - else if ( ( TRUE == pendingSpentChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) + else if ( getTestConfigStatus( TEST_CONFIG_DD_ENABLE_SPENT_CHAMBER_H_FILL ) == TRUE ) { - setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); - pendingSpentChamberFill = FALSE; - isDialDeliveryInProgress.data = FALSE; - state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + if ( ( TRUE == pendingSpentChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) + { + setModeGenDStateTransition( DD_GEND_SPENT_CHAMBER_FILL_STATE ); + pendingSpentChamberFill = FALSE; + isDialDeliveryInProgress.data = FALSE; + state = DD_GEND_SPENT_CHAMBER_FILL_STATE; + } } -#endif #ifdef __BICARB_CHAMBER_FILL__ else if ( ( TRUE == pendingBicarbChamberFill ) && ( FALSE == balancingChambFillInProgress ) ) { @@ -970,7 +972,7 @@ *************************************************************************/ static void checkDialysateTemperature( void ) { - F32 dialysateTemp = getConductivityTemperatureValue( D29_COND ); // Assuming the closest temp sensor to dialyzer + F32 dialysateTemp = getFilteredConductivitySensorTemperature( D29_COND ); // Assuming the closest temp sensor to dialyzer F32 targetTemp = getTDTargetDialysateTemperature(); BOOL isDialTempAboveHighSafety = ( dialysateTemp >= DIALYSATE_TEMP_UPPER_MAX_SAFETY_LIMIT_C ? TRUE : FALSE ); BOOL isDialTempAboveLowSafety = ( dialysateTemp > DIALYSATE_TEMP_UPPER_SAFETY_LIMIT_C ? TRUE : FALSE );