Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r5e2d30dcbd02f5eb737aee7ec45c63d868daf252 -rf6b78d1fe6741043de38707211710ab0e8a08483 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 5e2d30dcbd02f5eb737aee7ec45c63d868daf252) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision f6b78d1fe6741043de38707211710ab0e8a08483) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2022 Diality Inc. - All Rights Reserved. +* Copyright (c) 2020-2022 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file PresOccl.c * -* @author (last) Dara Navaei -* @date (last) 04-Jan-2022 +* @author (last) Hung Nguyen +* @date (last) 15-Feb-2022 * * @author (original) Sean * @date (original) 15-Jan-2020 @@ -80,9 +80,11 @@ #define OCCLUSION_THRESHOLD_OFFSET 10000 ///< Threshold offset. Combined with initial reading after cartridge install, a threshold is derived above which an occlusion is detected. #define OCCLUSION_CLEAR_THRESHOLD_OFFSET 6000 ///< Threshold offset. Combined with initial reading after cartridge install, a threshold is derived below which an occlusion is cleared. + #define CARTRIDGE_LOADED_THRESHOLD 5000 ///< Threshold above which a cartridge is considered loaded. -/// Occlusion sensors maximum pressure reading limit when cartridge is considered loaded. -#define OCCLUSION_CARTRIDGE_LOADED_PRESSURE_READING_MAX 20000 +#define MIN_OCCLUSION_COUNTS 2000 ///< Minimum occlusion sensor reading for range check. +#define MAX_OCCLUSION_COUNTS 32766 ///< Maximum occlusion sensor reading for range check. +#define OCCLUSION_CARTRIDGE_LOADED_PRESSURE_READING_MAX 26000 ///< Occlusion sensors maximum pressure reading limit when cartridge is considered loaded. #define EMPTY_SALINE_BAG_THRESHOLD_MMHG -300.0 ///< Threshold below which the saline bag is considered empty (in mmHg). TODO - get real threshold from Systems static const U32 EMPTY_SALINE_BAG_PERSISTENCE = ( 250 / TASK_GENERAL_INTERVAL ); ///< Time that saline bag looks empty before saying it is empty. @@ -666,7 +668,8 @@ *************************************************************************/ static void checkOcclusions( void ) { - U32 bpOccl = getMeasuredBloodPumpOcclusion(); + U32 bpOccl = getMeasuredBloodPumpOcclusion(); + BOOL outOfRange = ( bpOccl < MIN_OCCLUSION_COUNTS || bpOccl > MAX_OCCLUSION_COUNTS ? TRUE : FALSE ); if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PRESSURE_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) {