Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r92f7cf45960398664518966bfaa2199f287cf2bd --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 92f7cf45960398664518966bfaa2199f287cf2bd) @@ -56,6 +56,8 @@ #define OCCLUSION_THRESHOLD 25000 ///< Threshold above which an occlusion is detected. #define CARTRIDGE_LOADED_THRESHOLD 5000 ///< Threshold above which a cartridge is considered loaded. +#define EMPTY_SALINE_BAG_THRESHOLD_MMGH -200.0 ///< Threshold below which the saline bag is considered empty (in mmHg). TODO - get real threshold from Systems + #define PRES_ALARM_PERSISTENCE ( 1 * MS_PER_SECOND ) ///< Alarm persistence period for pressure alarms. /// Defined states for the pressure and occlusion monitor state machine. @@ -151,6 +153,28 @@ return result; } +/*********************************************************************//** + * @brief + * The isSalineBagEmpty function determines whether the saline bag is empty. + * It is assumed that this function will only be called when pumping (BP) from + * the saline bag. Determination is based on pressure going below a negative + * threshold. + * @details Inputs: arterial line pressure + * @details Outputs: none + * @return TRUE if arterial line pressure is below threshold, FALSE if not. + *************************************************************************/ +BOOL isSalineBagEmpty( void ) +{ + BOOL result = FALSE; + + if ( getMeasuredArterialPressure() < EMPTY_SALINE_BAG_THRESHOLD_MMGH ) + { + result = TRUE; + } + + return result; +} + /*********************************************************************//** * @brief * The execPresOccl function executes the pressure and occlusion monitor.