Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r42b82bcd2bb2c2fa07349108e6b2bd9995173fa4 -rde1c5ec969a5529cbdb7e66a4168fc11b9b3e58a --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 42b82bcd2bb2c2fa07349108e6b2bd9995173fa4) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision de1c5ec969a5529cbdb7e66a4168fc11b9b3e58a) @@ -212,7 +212,6 @@ static OVERRIDE_F32_T syringePumpDACVref = { 0.0, 0.0, 0.0, 0 };; ///< DAC Vref setting for force sensor. static BOOL requireSyringeDetection; ///< Flag indicating whether syringe detection is required in the current state. -static BOOL prevSyringeDetected; ///< Flag saving last state of syringe detection static F32 syringePumpSetRate; ///< Set rate for syringe pump (in mL/hr). static F32 forceAtEndOfSeek; ///< Force sensor reading in Volts at the end of seek. @@ -285,7 +284,6 @@ static BOOL checkDirection( BOOL stopPump, MOTOR_DIR_T expDir ); static BOOL checkSyringeEmpty( BOOL stopPump ); -static BOOL checkSyringeRemoved( BOOL stopPump ); static BOOL checkMaxTravel( BOOL stopPump, S32 maxPos ); static BOOL checkMeasRate( BOOL stopPump, F32 pctMargin ); static BOOL checkVolumeVsSafetyVolume( BOOL stopPump, F32 pctMargin ); @@ -315,7 +313,6 @@ syringePumpState = SYRINGE_PUMP_INIT_STATE; heparinDeliveryState = HEPARIN_STATE_OFF; requireSyringeDetection = FALSE; - prevSyringeDetected = FALSE; syringePumpSetRate = 0.0; syringePumpSetToggleTime = 0; syringePumpSafetyVolumeDelivered = 0.0; @@ -437,7 +434,6 @@ // Save syringe pump info for next time syringePumpLastPosition = getSyringePumpPosition(); - prevSyringeDetected = isSyringeDetected(); // Publish syringe pump data on interval publishSyringePumpData(); @@ -691,8 +687,7 @@ { heparinDeliveryState = HEPARIN_STATE_STOPPED; } - if ( ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) && ( TRUE == isSyringeDetected() ) && - ( TRUE == syringePumpPositionKnown ) ) + if ( ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) && ( TRUE == syringePumpPositionKnown ) ) { if ( ( heparinDeliveryState != HEPARIN_STATE_OFF ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_SYRINGE_PUMP_TESTING ) ) ) @@ -718,8 +713,7 @@ { heparinDeliveryState = HEPARIN_STATE_STOPPED; } - if ( ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) && ( TRUE == isSyringeDetected() ) && - ( TRUE == syringePumpPositionKnown ) ) + if ( ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) && ( TRUE == syringePumpPositionKnown ) ) { if ( ( ( heparinDeliveryState != HEPARIN_STATE_OFF ) && ( TRUE == syringePumpPlungerFound ) ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_SYRINGE_PUMP_TESTING ) ) ) @@ -795,7 +789,7 @@ { heparinDeliveryState = HEPARIN_STATE_STOPPED; } - if ( ( TRUE == isSyringeDetected() ) && ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) ) + if ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) { if ( ( ( TRUE == syringePumpPrimeCompleted ) && ( HEPARIN_STATE_STOPPED == heparinDeliveryState ) ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_SYRINGE_PUMP_TESTING ) ) ) @@ -839,7 +833,7 @@ { heparinDeliveryState = HEPARIN_STATE_STOPPED; } - if ( ( TRUE == isSyringeDetected() ) && ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) ) + if ( SYRINGE_PUMP_OFF_STATE == syringePumpState ) { if( ( ( HEPARIN_STATE_STOPPED == heparinDeliveryState ) || ( HEPARIN_STATE_PAUSED == heparinDeliveryState ) ) || ( TRUE == getTestConfigStatus( TEST_CONFIG_ENABLE_SYRINGE_PUMP_TESTING ) ) ) @@ -925,29 +919,8 @@ } } - /*********************************************************************//** * @brief - * The isSyringeDetected function determines whether a syringe is currently - * detected. - * @details \b Inputs: syringePumpMeasSyringeDetectionSwitch - * @details \b Outputs: none - * @return TRUE if syringe detected, FALSE if not - *************************************************************************/ -BOOL isSyringeDetected( void ) -{ - BOOL result = FALSE; - - if ( getSyringePumpSyringeDetectorV() >= SYRINGE_PUMP_SYRINGE_DETECT_THRESHOLD_V ) - { - result = TRUE; - } - - return result; -} - -/*********************************************************************//** - * @brief * The isSyringePumpHome function determines whether the syringe drive position * is at the home position. * @details \b Inputs: syringePumpMeasHome @@ -1106,45 +1079,6 @@ syringePumpMeasSyringeDetectionSwitch.data = ( (F32)getFPGASyringePumpADCChannel1() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; } - // Handle syringe detect alarm management -#ifndef _RELEASE_ -// if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) -#endif - { - F32 bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); - F32 hepRate = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_DELIVERY_RATE ); - - // Syringe detection not required if not using Heparin in treatment - if ( ( bolusVol > NEARLY_ZERO ) || ( hepRate > NEARLY_ZERO ) ) - { - // On transition from not detected to detected or if syringe detection not required - clear syringe removed alarm condition - if ( ( ( prevSyringeDetected != TRUE ) && ( TRUE == isSyringeDetected() ) ) || ( requireSyringeDetection != TRUE ) ) - { - clearAlarmCondition( ALARM_ID_TD_SYRINGE_PUMP_SYRINGE_REMOVED ); - } - // If no syringe detected and detection is required, trigger alarm condition - else if ( FALSE == isSyringeDetected() ) - { - activateAlarmNoData( ALARM_ID_TD_SYRINGE_PUMP_SYRINGE_REMOVED ); - } - // On transition from detected to not detected - clear syringe detected alarm condition - if ( ( TRUE == prevSyringeDetected ) && ( isSyringeDetected() != TRUE ) ) - { - clearAlarmCondition( ALARM_ID_TD_SYRINGE_DETECTED ); - } - // If syringe detected and alarm active, maintain alarm condition - else if ( ( TRUE == isSyringeDetected() ) && ( TRUE == isAlarmActive( ALARM_ID_TD_SYRINGE_DETECTED ) ) ) - { - activateAlarmNoData( ALARM_ID_TD_SYRINGE_DETECTED ); - } - } - else - { - clearAlarmCondition( ALARM_ID_TD_SYRINGE_PUMP_SYRINGE_REMOVED ); - clearAlarmCondition( ALARM_ID_TD_SYRINGE_DETECTED ); - } - } - syringePumpMeasForce.data = ( (F32)getFPGASyringePumpADCChannel0() * SYRINGE_PUMP_ADC_REF_V ) / SYRINGE_PUMP_ADC_FULL_SCALE_BITS; // Apply home offset to encoder position @@ -1494,9 +1428,6 @@ // Check for stall stopPump = checkForStall( stopPump ); - // Has syringe been removed? - stopPump = checkSyringeRemoved( stopPump ); - // Check max position > empty + 0.5 mL stopPump = checkMaxTravel( stopPump, SYRINGE_PUMP_EMPTY_POS + SYRINGE_PUMP_EMPTY_POS_MARGIN ); @@ -1550,9 +1481,6 @@ // Check for stall stopPump = checkForStall( stopPump ); - // Has syringe been removed? - stopPump = checkSyringeRemoved( stopPump ); - // Check position > max travel stopPump = checkMaxTravel( stopPump, syringePumpVolumeStartPosition + ( SYRINGE_PUMP_PRIME_VOLUME_ML * TEN_PCT_OVER_ALLOWANCE * SYRINGE_ENCODER_COUNTS_PER_ML ) ); @@ -1591,9 +1519,6 @@ stopPump = TRUE; } - // Has syringe been removed? - stopPump = checkSyringeRemoved( stopPump ); - // Check volume vs. safety volume stopPump = checkVolumeVsSafetyVolume( stopPump, SYRINGE_PUMP_VOLUME_CHECK_MARGIN ); @@ -1635,9 +1560,6 @@ // Handle ramp up rampSyringePump(); - // Has syringe been removed? - stopPump = checkSyringeRemoved( stopPump ); - // Check for syringe pump empty stopPump = checkSyringeEmpty( stopPump ); @@ -1922,32 +1844,8 @@ return result; } - /*********************************************************************//** * @brief - * The checkSyringeRemoved function checks whether the syringe has been removed. - * This function should only be called from states that require the syringe to - * be installed. - * @details \b Inputs: syringePumpMeasSyringeDetectionSwitch.data - * @details \b Outputs: alarm triggered if syringe not detected - * @param stopPump flag passed in by caller indicating whether pump should be stopped - * @return TRUE if pump should be stopped, FALSE if not - *************************************************************************/ -static BOOL checkSyringeRemoved( BOOL stopPump ) -{ - BOOL result = stopPump; - - if ( FALSE == isSyringeDetected() ) - { - result = TRUE; - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_TD_SYRINGE_PUMP_SYRINGE_REMOVED, (U32)syringePumpState ) - } - - return result; -} - -/*********************************************************************//** - * @brief * The checkMaxTravel function checks whether a maximum travel (position) * has been exceeded. This threshold is state dependent so the calling function * must provide the maximum position to apply. Index: firmware/App/Controllers/SyringePump.h =================================================================== diff -u -r42b82bcd2bb2c2fa07349108e6b2bd9995173fa4 -rde1c5ec969a5529cbdb7e66a4168fc11b9b3e58a --- firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision 42b82bcd2bb2c2fa07349108e6b2bd9995173fa4) +++ firmware/App/Controllers/SyringePump.h (.../SyringePump.h) (revision de1c5ec969a5529cbdb7e66a4168fc11b9b3e58a) @@ -138,7 +138,6 @@ void syringeDetectionRequired( BOOL req ); void syringePumpVerifyForceSensorDACCalibration( void ); -BOOL isSyringeDetected( void ); BOOL isSyringePumpHome( void ); BOOL isSyringePumpStopped( void ); BOOL isSyringePlungerFound( void );