Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -rd57c55e32e449059a9b07a3ae1d3ec15c9f40f05 -r9a824381a8c77e309b943bedcccc8df323bb26e3 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision d57c55e32e449059a9b07a3ae1d3ec15c9f40f05) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 9a824381a8c77e309b943bedcccc8df323bb26e3) @@ -1588,9 +1588,9 @@ * @param stopPump flag passed in by caller indicating whether pump should be stopped * @return TRUE if pump should be stopped, FALSE if not *************************************************************************/ -BOOL checkForPrimeOcclusion( BOOL stopPump ) +BOOL checkForPrimeOcclusion( void ) { - BOOL result = stopPump; + BOOL result = FALSE; // Return FALSE if no occlusion is detected F32 forceAtEndOfPriming = getSyringePumpForceV(); // Read the force sensor at the end of the priming F32 forceDelta = forceAtEndOfPriming - forceAtEndOfSeek; // Occlusion is detected if force at end of prime is > than force at end of seek by ~ 0.5 volts Index: firmware/App/Controllers/SyringePump.h =================================================================== diff -u -rbc538f960d0bc8c72991817ea52efac4775ce953 -r9a824381a8c77e309b943bedcccc8df323bb26e3 --- firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision bc538f960d0bc8c72991817ea52efac4775ce953) +++ firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 9a824381a8c77e309b943bedcccc8df323bb26e3) @@ -84,7 +84,7 @@ BOOL retractSyringePump( void ); BOOL seekSyringePlunger( void ); BOOL primeSyringePump( void ); -BOOL checkForPrimeOcclusion( BOOL stopPump ); +BOOL checkForPrimeOcclusion( void ); void resetHeparinVolumeDelivered( void ); BOOL startHeparinBolus( void ); BOOL startHeparinContinuous( void ); Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -rd57c55e32e449059a9b07a3ae1d3ec15c9f40f05 -r9a824381a8c77e309b943bedcccc8df323bb26e3 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision d57c55e32e449059a9b07a3ae1d3ec15c9f40f05) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 9a824381a8c77e309b943bedcccc8df323bb26e3) @@ -1037,7 +1037,7 @@ if ( TRUE == didTimeout( syringeOcclusionDelayStartTime, SYRINGE_PUMP_OCCLUSION_CHECK_DELAY ) ) { - stopPump = checkForPrimeOcclusion( stopPump ); + stopPump = checkForPrimeOcclusion(); state = DRY_SELF_TESTS_COMPLETE_STATE; } @@ -1117,14 +1117,25 @@ if ( FALSE == cmdResp.rejected ) { - F32 bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); + if ( ( TRUE == isValvesSettingSent ) && ( TRUE == getDGCommandResponse( DG_CMD_VALVE_SETTING, &cmdResp ) ) ) + { + // Re-send command if DG rejects + isValvesSettingSent = FALSE; - setDialInPumpTargetFlowRate( DIP_FLOW_RATE_SETUP_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); - fmdIntegratedVolume = 0.0; + if ( FALSE == cmdResp.rejected ) + { + F32 bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); - if ( ( bolusVol > 0.0 ) && ( getSyringePumpVolumeDelivered() < bolusVol ) ) - { - startHeparinBolus(); // moved here from startHeparinPump() in Dialysis.c + setDialInPumpTargetFlowRate( DIP_FLOW_RATE_SETUP_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); + fmdIntegratedVolume = 0.0; + + if ( ( bolusVol > 0.0 ) && ( getSyringePumpVolumeDelivered() < bolusVol ) ) + { + startHeparinBolus(); // moved here from startHeparinPump() in Dialysis.c + } + + state = WET_SELF_TESTS_SETUP_STATE; + } } state = WET_SELF_TESTS_SETUP_STATE;