Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r6419179374edcd65da462de84e8aeaefb7e20320 -r5d13922ee2e8c851bc5db67ef4d0120b47de6f07 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 6419179374edcd65da462de84e8aeaefb7e20320) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 5d13922ee2e8c851bc5db67ef4d0120b47de6f07) @@ -147,8 +147,7 @@ U32 diOccl = getMeasuredDialInPumpOcclusion(); U32 doOccl = getMeasuredDialOutPumpOcclusion(); - if ( ( bpOccl >= CARTRIDGE_LOADED_THRESHOLD ) && - ( diOccl >= CARTRIDGE_LOADED_THRESHOLD ) && + if ( ( bpOccl >= CARTRIDGE_LOADED_THRESHOLD ) && ( diOccl >= CARTRIDGE_LOADED_THRESHOLD ) && ( doOccl >= CARTRIDGE_LOADED_THRESHOLD ) ) { result = TRUE; @@ -159,6 +158,23 @@ /*********************************************************************//** * @brief + * The isCartridgeUnloaded function determines if a cartridge has been + * unloaded by looking at the 3 occlusion pressure sensors. + * @details Inputs: occlusion pressures for the pumps + * @details Outputs: none + * @return TRUE if all 3 occlusion sensors read below loaded threshold, FALSE if not. + *************************************************************************/ +BOOL isCartridgeUnloaded( void ) +{ + BOOL const bpOcclBelowLoadedThreshold = getMeasuredBloodPumpOcclusion() <= CARTRIDGE_LOADED_THRESHOLD; + BOOL const diOcclBelowLoadedThreshold = getMeasuredDialInPumpOcclusion() <= CARTRIDGE_LOADED_THRESHOLD; + BOOL const doOcclBelowLoadedThreshold = getMeasuredDialOutPumpOcclusion() <= CARTRIDGE_LOADED_THRESHOLD; + + return ( bpOcclBelowLoadedThreshold && diOcclBelowLoadedThreshold && doOcclBelowLoadedThreshold ); +} + +/*********************************************************************//** + * @brief * The isSalineBagEmpty function determines whether the saline bag is empty. * It is assumed that this function will only be called from mode handling * (General Task) when pumping (BP) from the saline bag.