Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -r0a4dcd288d4347b85baaa0b07da568b6add5eac7 -r4fdc707c6335822e4567eba03cfcad251f13cd4d --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 0a4dcd288d4347b85baaa0b07da568b6add5eac7) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision 4fdc707c6335822e4567eba03cfcad251f13cd4d) @@ -8,7 +8,7 @@ * @file SyringePump.c * * @author (last) Sean Nash -* @date (last) 01-Dec-2022 +* @date (last) 07-Feb-2023 * * @author (original) Sean Nash * @date (original) 04-Mar-2021 @@ -296,15 +296,8 @@ syringePumpHomePositionOffset = 0; syringePumpLastPosition = 0; syringePumpVolumeRequired = 0.0; - -#ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_SYRINGE_PUMP_ALARMS ) != SW_CONFIG_ENABLE_VALUE ) - { - syringePumpControllerMeasuredDirection = MOTOR_DIR_FORWARD; - syringePumpEncoderMeasuredDirection = MOTOR_DIR_FORWARD; - } -#endif - + syringePumpControllerMeasuredDirection = MOTOR_DIR_FORWARD; + syringePumpEncoderMeasuredDirection = MOTOR_DIR_FORWARD; syringePumpDataPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; syringePumpSpeedCalcTimerCounter = 0; syringePumpRampTimerCtr = 0; @@ -479,6 +472,18 @@ /*********************************************************************//** * @brief + * The resetPreLoadStatus function resets the syringe pump pre-load status. + * @details Inputs: none + * @details Outputs: syringePumpPreLoadCompleted + * @return none + *************************************************************************/ +void resetPreLoadStatus( void ) +{ + syringePumpPreLoadCompleted = FALSE; +} + +/*********************************************************************//** + * @brief * The stopSyringePump function requests syringe pump be stopped. * @details Inputs: none * @details Outputs: syringePumpSetRate, syringePumpState, heparinDeliveryState @@ -1149,6 +1154,7 @@ *************************************************************************/ void execSyringePump( void ) { + SYRINGE_PUMP_STATE_T priorSyringeState = syringePumpState; // Execute syringe pump monitor execSyringePumpMonitor(); @@ -1207,6 +1213,11 @@ break; } + if ( priorSyringeState != syringePumpState ) + { + SEND_EVENT_WITH_2_U32_DATA( HD_EVENT_SYRINGE_PUMP_STATE, priorSyringeState, syringePumpState ); + } + resetSyringePumpRequestFlags(); // Publish syringe pump data on interval @@ -1399,7 +1410,6 @@ syringePumpPlungerFound = FALSE; syringeVolumeAdequate = FALSE; syringePumpPrimeCompleted = FALSE; - syringePumpPreLoadCompleted = FALSE; syringePumpVolumeRequired = 0.0F; // Clear insufficient volume alarm condition in case we're retracting to allow user to resolve alarm clearAlarmCondition( ALARM_ID_HD_SYRINGE_PUMP_NOT_ENOUGH_HEPARIN_ALARM ); @@ -1519,10 +1529,9 @@ syringePumpVolumeDelivered.data = 0.0; syringePumpSafetyVolumeDelivered = 0.0; syringePumpVolumeStartPosition = pos; - syringePumpPreLoadCompleted = FALSE; - // Check estimated syringe volume needed for treatment vs. volume detected - if insufficient for treatment needs, alarm - if ( syringeVol >= txVolume ) + // Check estimated syringe volume needed for treatment vs. volume detected - if insufficient for treatment needs, alarm (check only applies in pre-tx mode) + if ( ( syringeVol >= txVolume ) || ( getCurrentOperationMode() != MODE_PRET ) ) { syringePumpPlungerFound = TRUE; syringeVolumeAdequate = TRUE; @@ -1581,7 +1590,6 @@ syringePumpVolumeDelivered.data = 0.0; syringePumpSafetyVolumeDelivered = 0.0; syringePumpVolumeStartPosition = syringePumpPosition.data; - syringePumpPreLoadCompleted = FALSE; } // Has syringe been removed?