Index: firmware/App/Modes/Prime.c =================================================================== diff -u -r12708a04ae3365e11180182fc52d005c229a7bc6 -r269d7db0f5a8e7b1a14210e316e9823ec3ea9e3d --- firmware/App/Modes/Prime.c (.../Prime.c) (revision 12708a04ae3365e11180182fc52d005c229a7bc6) +++ firmware/App/Modes/Prime.c (.../Prime.c) (revision 269d7db0f5a8e7b1a14210e316e9823ec3ea9e3d) @@ -7,8 +7,8 @@ * * @file Prime.c * -* @author (last) Sean Nash -* @date (last) 03-May-2023 +* @author (last) Dara Navaei +* @date (last) 08-May-2023 * * @author (original) Quang Nguyen * @date (original) 08-Dec-2020 @@ -61,7 +61,8 @@ #define LOAD_CELL_STEADY_VOLUME_SAMPLING_TIME ( 1 * MS_PER_SECOND ) ///< Time load cell reading steady state detection sampling time in seconds. #define PRIME_DIALYSATE_BYPASS_TIME_LIMIT ( 8 * MS_PER_SECOND ) ///< Time limit for priming dialysate bypass circuit. #define STEADY_VOLUME_COUNT_SEC ( 10000 / LOAD_CELL_STEADY_VOLUME_SAMPLING_TIME ) ///< Counter must be greater than 10 seconds before steady volume is true. -#define STEADY_VOLUME_TIME_DEADLINE_MS ( 55 * MS_PER_SECOND ) ///< Time in msec for the steady volume deadline time out. +#define STEADY_VOLUME_DIALYSATE_PRIME_TIME_LIMIT_MS ( 55 * MS_PER_SECOND ) ///< Time in msec for the reservoir volume to stabilize during dialysate prime state. +#define STEADY_VOLUME_BYPASS_PRIME_TIME_LIMIT_MS ( 25 * MS_PER_SECOND ) ///< Time in msec for the reservoir volume to stabilize during bypass dialysate prime state. #define VENOUS_PRESSURE_BUBBLE_CLEAR_MAX_MMHG ( 200.0F ) ///< Maximum venous pressure reading (in mmHg) for bubble clear. #define BUBBLE_CLEAR_WAIT_TIME_INITIAL_MS ( 10 * MS_PER_SECOND ) ///< Time in msec to wait for initial bubble clear pressure. @@ -199,12 +200,7 @@ signalDialInPumpHardStop(); signalDialOutPumpHardStop(); stopSyringePump(); -#ifndef _RELEASE_ - if ( SW_CONFIG_DISABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_DISABLE_AIR_PUMP ) ) -#endif - { - setAirPumpState( AIR_PUMP_STATE_OFF ); - } + setAirPumpState( AIR_PUMP_STATE_OFF ); // Set valves to default positions setValveAirTrap( STATE_CLOSED ); @@ -491,11 +487,12 @@ } else #endif - - if ( TRUE == primeStartRequested ) { - primeStartRequested = FALSE; - state = HD_PRIME_SALINE_SETUP_STATE; + if ( TRUE == primeStartRequested ) + { + primeStartRequested = FALSE; + state = HD_PRIME_SALINE_SETUP_STATE; + } } return state; @@ -778,7 +775,7 @@ steadyVolumeSamplingStartTime = getMSTimerCount(); } - if ( TRUE == didTimeout( primeDialysateDialyzerStartTime, primeDialysateDialyzerTimeLimit + STEADY_VOLUME_TIME_DEADLINE_MS ) ) + if ( TRUE == didTimeout( primeDialysateDialyzerStartTime, primeDialysateDialyzerTimeLimit + STEADY_VOLUME_DIALYSATE_PRIME_TIME_LIMIT_MS ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_PRIME_DIALYSATE_DIALYZER_TIME_OUT, primeDialysateDialyzerTimeLimit ); } @@ -942,7 +939,7 @@ steadyVolumeSamplingStartTime = getMSTimerCount(); } - if ( TRUE == didTimeout( primeDialysateBypassStartTime, PRIME_DIALYSATE_BYPASS_TIME_LIMIT + STEADY_VOLUME_TIME_DEADLINE_MS ) ) // allocate 55 seconds for the steady state logic to do its job before timing out + if ( TRUE == didTimeout( primeDialysateBypassStartTime, PRIME_DIALYSATE_BYPASS_TIME_LIMIT + STEADY_VOLUME_BYPASS_PRIME_TIME_LIMIT_MS ) ) // allocate 25 seconds for the steady state logic to do its job before timing out { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_PRIME_DIALYSATE_BYPASS_TIME_OUT, PRIME_DIALYSATE_BYPASS_TIME_LIMIT ); }