Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -ra3741a7adf533bbc6683d9c4f3efbcfa9e989ba7 -r39c791d03f363ce2c684597080fc8c2f5515976f --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision a3741a7adf533bbc6683d9c4f3efbcfa9e989ba7) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 39c791d03f363ce2c684597080fc8c2f5515976f) @@ -934,6 +934,21 @@ /*********************************************************************//** * @brief + * The isSyringePumpRunning function determines whether the syringe pump + * is currently running an operation. + * @details Inputs: syringePumpState + * @details Outputs: none + * @return TRUE if syringe pump operation is currently running, FALSE if not. + *************************************************************************/ +BOOL isSyringePumpRunning( void ) +{ + BOOL result = ( syringePumpState > SYRINGE_PUMP_OFF_STATE ? TRUE : FALSE ); + + return result; +} + +/*********************************************************************//** + * @brief * The execSyringePumpMonitor function executes the syringe pump monitor. * @details Inputs: FPGA syringe pump readings * @details Outputs: Alarm(s) may be triggered Index: firmware/App/Controllers/SyringePump.h =================================================================== diff -u -r24b2fe72608344e67ef37234085d15ad5e4fcc37 -r39c791d03f363ce2c684597080fc8c2f5515976f --- firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 24b2fe72608344e67ef37234085d15ad5e4fcc37) +++ firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 39c791d03f363ce2c684597080fc8c2f5515976f) @@ -95,6 +95,7 @@ BOOL isSyringePlungerFound( void ); BOOL isSyringeVolumeAdequate( void ); BOOL isSyringePumpPrimed( void ); +BOOL isSyringePumpRunning( void ); F32 getSyringePumpVolumeDelivered( void ); BOOL testSetSyringePumpDataPublishIntervalOverride( U32 value ); Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -rcf0f5e54c1a7af4d8a739cbd677d899d95e4019b -r39c791d03f363ce2c684597080fc8c2f5515976f --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision cf0f5e54c1a7af4d8a739cbd677d899d95e4019b) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 39c791d03f363ce2c684597080fc8c2f5515976f) @@ -973,9 +973,9 @@ if ( TRUE == useHeparin ) { - if ( TRUE == isSyringePlungerFound() ) + if ( FALSE == isSyringePumpRunning() ) { - if ( TRUE == isSyringeVolumeAdequate() ) + if ( TRUE == isSyringePlungerFound() ) { if ( TRUE == isSyringePumpPrimed() ) { @@ -988,13 +988,16 @@ } else { - retractSyringePump(); + if ( TRUE == isAlarmActive( ALARM_ID_HD_SYRINGE_PUMP_NOT_ENOUGH_HEPARIN_ALARM ) ) + { + retractSyringePump(); + } + else if ( TRUE == isSyringePumpHome() ) + { + seekSyringePlunger(); + } } } - else - { - seekSyringePlunger(); - } } else {