Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r21ba197508c6498ea0c39f495526f4acd947df1e -r04f8c319026c94e3846464775fc8920a0306d751 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 21ba197508c6498ea0c39f495526f4acd947df1e) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 04f8c319026c94e3846464775fc8920a0306d751) @@ -7,8 +7,8 @@ * * @file SyringePump.c * -* @author (last) Sean Nash -* @date (last) 30-Sep-2023 +* @author (last) Darren Cox +* @date (last) 09-Oct-2023 * * @author (original) Sean Nash * @date (original) 04-Mar-2021 @@ -511,11 +511,11 @@ *************************************************************************/ void stopSyringePump( void ) { - syringePumpSetRate = 0.0; setFPGASyringePumpStepToggleTime( SYRINGE_PUMP_MICROSTEP_TOGGLE_TIME_FOR_STOP ); if ( ( syringePumpState != SYRINGE_PUMP_CONFIG_FORCE_SENSOR_STATE ) && ( syringePumpState != SYRINGE_PUMP_OFF_STATE ) ) { syringePumpState = SYRINGE_PUMP_OFF_STATE; + syringePumpSetRate = 0.0; } if ( ( HEPARIN_STATE_INITIAL_BOLUS == heparinDeliveryState ) || ( HEPARIN_STATE_DISPENSING == heparinDeliveryState ) ) { @@ -528,6 +528,7 @@ sendTreatmentLogEventData( HEPARIN_STOP_PAUSE_EVENT, syringePumpSetRate, 0.0 ); } heparinDeliveryState = HEPARIN_STATE_STOPPED; + syringePumpSetRate = 0.0; } } @@ -645,6 +646,8 @@ *************************************************************************/ BOOL startHeparinBolus( void ) { + F32 bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); + // If valid to start a bolus, kick it off if ( FALSE == isSyringePumpHome() ) { @@ -655,8 +658,12 @@ if ( ( TRUE == isSyringeDetected() ) && ( TRUE == syringePumpPrimeCompleted ) && ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) && ( HEPARIN_STATE_STOPPED == heparinDeliveryState ) ) { - syringePumpSetRate = getHeprinBolusTargetRate(); - syringePumpBolusRequested = TRUE; + // if user set a Heparin bolus volume and not complete, start now + if ( ( bolusVol > 0.0F ) && ( getSyringePumpVolumeDelivered() < bolusVol ) ) + { + syringePumpSetRate = getHeprinBolusTargetRate(); + syringePumpBolusRequested = TRUE; + } } } else