Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -r14d740bbb065f043daaa348bcda5f447e1c16a32 -r0665a32e26dd466378e6ea6fda940353afc691f1 --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 14d740bbb065f043daaa348bcda5f447e1c16a32) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 0665a32e26dd466378e6ea6fda940353afc691f1) @@ -33,12 +33,12 @@ // ********** private definitions ********** -/// Interval (ms/task time) at which the air trap data is published on the CAN bus. -#define AIR_TRAP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) + +#define AIR_TRAP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the air trap data is published on the CAN bus. +#define AIR_TRAP_FILL_TIMEOUT_MS ( 6 * MS_PER_SECOND ) ///< Air trap fill timeout period (in ms). #define AIR_PUMP_UPPER_LEVEL_PERSISTENCE ( 100 / TASK_GENERAL_INTERVAL ) ///< Persistence time for air pump operation after air trap upper level reads air. /// Persistence period for illegal level sensors fault. static const U32 AIR_TRAP_ILLEGAL_LEVELS_PERSISTENCE = ( MS_PER_SECOND * 2 / TASK_GENERAL_INTERVAL ); -static const U32 AIR_TRAP_UPPER_LEVEL_PERSISTENCE = ( MS_PER_SECOND * 2 / TASK_GENERAL_INTERVAL ); /// Volume (in mL) of venous portion of blood circuit line. TODO - get actual volume from Systems. #define VENOUS_LINE_VOLUME_ML ( 200.0F ) @@ -69,7 +69,6 @@ static U32 fillStartTime = 0; ///< Time stamp for start of air trap fill. static U32 airPumpUpperLevelCtr = 0; ///< Timer count for air pump persistence. -static U32 airTrapUpperLevelCtr = 0; ///< Timer count for upper level persistence. static U32 airTrapIllegalLevelSensorsCtr = 0; ///< Timer counter for illegal level sensor fault. // ********** private function prototypes ********** @@ -185,24 +184,11 @@ airTrapLevels[ AIR_TRAP_LEVEL_SENSOR_LOWER ].data = (U32)( TRUE == lower ? AIR_TRAP_LEVEL_AIR : AIR_TRAP_LEVEL_FLUID ); airTrapLevels[ AIR_TRAP_LEVEL_SENSOR_UPPER ].data = (U32)( TRUE == upper ? AIR_TRAP_LEVEL_AIR : AIR_TRAP_LEVEL_FLUID ); - if ( ( MODE_TREA == getCurrentOperationMode() ) && - ( AIR_TRAP_LEVEL_FLUID == getAirTrapLevel( AIR_TRAP_LEVEL_SENSOR_UPPER ) ) && - ( AIR_TRAP_VALVE_OPEN_STATE == airTrapControllerState ) ) + // Clear fill timeout alarm condition if low level sensor sees fluid + if ( AIR_TRAP_LEVEL_FLUID == getAirTrapLevel( AIR_TRAP_LEVEL_SENSOR_LOWER ) ) { - if ( ++airTrapUpperLevelCtr >= AIR_TRAP_UPPER_LEVEL_PERSISTENCE ) - { -#ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ILLEGAL_AIR_TRAP_ALARM ) != SW_CONFIG_ENABLE_VALUE ) -#endif - { - activateAlarmNoData( ALARM_ID_HD_AIR_TRAP_OVERFILL ); - } - } + clearAlarmCondition( ALARM_ID_AIR_TRAP_FILL_DURING_TREATMENT ); } - else - { - airTrapUpperLevelCtr = 0; - } // Check level readings are valid if ( ( AIR_TRAP_LEVEL_AIR == getAirTrapLevel( AIR_TRAP_LEVEL_SENSOR_LOWER ) ) && @@ -241,10 +227,7 @@ // Check air trap fill timeout during treatment if ( AIR_TRAP_VALVE_OPEN_STATE == airTrapControllerState ) { - F32 bldFlowRate = (F32)getTreatmentParameterU32( TREATMENT_PARAM_BLOOD_FLOW ); // Function will never return zero - F32 fillTimeoutMS = ( VENOUS_LINE_VOLUME_ML / bldFlowRate ) * (F32)SEC_PER_MIN * (F32)MS_PER_SECOND; - - if ( TRUE == didTimeout( fillStartTime, fillTimeoutMS ) ) + if ( TRUE == didTimeout( fillStartTime, AIR_TRAP_FILL_TIMEOUT_MS ) ) { #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_AIR_TRAP_LEVELING_ALARM ) != SW_CONFIG_ENABLE_VALUE )