Index: firmware/App/Controllers/AirPump.c =================================================================== diff -u -rf760ffc4b10556e5186e9ceb90294262063440ca -rb757b489a3122e6624d2d266b8618a9b2b9353db --- firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision f760ffc4b10556e5186e9ceb90294262063440ca) +++ firmware/App/Controllers/AirPump.c (.../AirPump.c) (revision b757b489a3122e6624d2d266b8618a9b2b9353db) @@ -37,7 +37,7 @@ #define AIR_PUMP_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) #define DATA_PUBLISH_COUNTER_START_COUNT 13 #define AIR_PUMP_GPIO_PIN 0x04 -#define AIR_PUMP_OPERATION_TIMEOUT ( 6 * MS_PER_SECOND ) +#define AIR_PUMP_OPERATION_TIMEOUT ( 10 * MS_PER_SECOND ) typedef enum AirPumpMotorStates { Index: firmware/App/Controllers/AirTrap.c =================================================================== diff -u -r8e4a186b144ce6bb0de2ca04ae623f63f2ee525e -rb757b489a3122e6624d2d266b8618a9b2b9353db --- firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision 8e4a186b144ce6bb0de2ca04ae623f63f2ee525e) +++ firmware/App/Controllers/AirTrap.c (.../AirTrap.c) (revision b757b489a3122e6624d2d266b8618a9b2b9353db) @@ -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,27 +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 - { - if ( airTrapUpperLevelCtr > 0 ) - { - airTrapUpperLevelCtr = 0; - } - } // Check level readings are valid if ( ( AIR_TRAP_LEVEL_AIR == getAirTrapLevel( AIR_TRAP_LEVEL_SENSOR_LOWER ) ) && @@ -244,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 )