Index: firmware/App/Modes/Prime.c =================================================================== diff -u -rba7a576375ad7bbfa0d5a879d82b8783e5182899 -r838df450f09668adbd73e61fadbff8c81fe7926e --- firmware/App/Modes/Prime.c (.../Prime.c) (revision ba7a576375ad7bbfa0d5a879d82b8783e5182899) +++ firmware/App/Modes/Prime.c (.../Prime.c) (revision 838df450f09668adbd73e61fadbff8c81fe7926e) @@ -38,14 +38,14 @@ #define MAX_PRIME_TIME ( 10 * SEC_PER_MIN ) ///< Maximum prime time (in seconds). #define PRIME_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the prime data is published on the CAN bus. -#define BLOOD_PUMP_FLOW_RATE_PURGE_AIR 100 ///< Blood pump flow rate during prime purge air state. +#define BLOOD_PUMP_FLOW_RATE_PURGE_AIR 500 ///< Blood pump flow rate during prime purge air state. #define BLOOD_PUMP_FLOW_RATE_CIRC_BLOOD_CIRCUIT 300 ///< Blood pump flow rate during prime recirculate blood circuit state. #define DIALYSATE_PUMP_PRIME_FLOW_RATE 300 ///< Dialysate pump flow rate during priming fluid path. #define LOAD_CELL_VOLUME_NOISE_TOLERANCE 0.05 ///< Allow 5% tolerance on load cell readings. -#define NO_AIR_DETECTED_COUNT ( 10 * MS_PER_SECOND ) ///< No air detected time period count. -#define PURGE_AIR_TIME_OUT_COUNT ( 30 * MS_PER_SECOND ) ///< Time period count for purge air time out. +#define NO_AIR_DETECTED_COUNT ( 20 * MS_PER_SECOND ) ///< No air detected time period count. +#define PURGE_AIR_TIME_OUT_COUNT ( 60 * MS_PER_SECOND ) ///< Time period count for purge air time out. #define MIN_LOAD_CELL_STEADY_VOLUME_TIME ( 10 * MS_PER_SECOND ) ///< Minimum time load cell reading need to remain steady in ms. #define PRIME_DIALYSATE_DIALYZER_TIME_LIMIT ( 120 * MS_PER_SECOND ) ///< Time limit for priming dialysate dialyzer circuit. #define PRIME_DIALYSATE_BYPASS_TIME_LIMIT ( 120 * MS_PER_SECOND ) ///< Time limit for priming dialysate bypass circuit. @@ -84,6 +84,7 @@ static U32 primeDialysateBypassStartTime; ///< Starting time of priming dialysate bypass circuit. static U32 previousLoadCellReading; ///< Previous load cell reading. static U32 loadcellSteadyVolumeStartTime; ///< Load cell steady volume starting time. +static BOOL runBloodCircuitPrimeAgain; ///< Flag indicates HD should run blood circuit prime once more time. // ********** private function prototypes ********** @@ -132,6 +133,7 @@ primeStartTime = getMSTimerCount(); primePauseStartTime = 0; primeStatusBroadcastTimerCounter = 0; + runBloodCircuitPrimeAgain = TRUE; setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); @@ -338,6 +340,8 @@ setValvePosition( VBV, VALVE_POSITION_C_CLOSE ); setValveAirTrap( STATE_OPEN ); + signalDialOutPumpHardStop(); + signalDialInPumpHardStop(); setBloodPumpTargetFlowRate( BLOOD_PUMP_FLOW_RATE_PURGE_AIR, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); } @@ -532,7 +536,15 @@ { if ( TRUE == didTimeout( loadcellSteadyVolumeStartTime, MIN_LOAD_CELL_STEADY_VOLUME_TIME ) ) { - state = HD_PRIME_RESERVOIR_TWO_FILL_COMPLETE_STATE; + if ( TRUE == runBloodCircuitPrimeAgain ) + { + runBloodCircuitPrimeAgain = FALSE; + state = HD_PRIME_SALINE_SETUP_STATE; + } + else + { + state = HD_PRIME_RESERVOIR_TWO_FILL_COMPLETE_STATE; + } } } else