Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -ra7675f3c917b632cf16207fc7ccfc1f38eb83f9b -r27a68f930508638f2eb6265ebb381c8918cbc37b --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision a7675f3c917b632cf16207fc7ccfc1f38eb83f9b) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 27a68f930508638f2eb6265ebb381c8918cbc37b) @@ -7,8 +7,8 @@ * * @file PresOccl.c * -* @author (last) Dara Navaei -* @date (last) 03-Mar-2022 +* @author (last) Darren Cox +* @date (last) 10-Mar-2022 * * @author (original) Sean * @date (original) 15-Jan-2020 @@ -422,6 +422,7 @@ #ifndef _RELEASE_ if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_DVT_ARTERIAL_PRESSURE_SENSOR ) ) { +#endif if ( ARTERIAL_PRESSURE_NORMAL_OP == artPresStatus ) { U08 artReadCtr = getFPGADVTArterialPressureReadCounter(); @@ -447,38 +448,41 @@ resetPersistentAlarmTimer( ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT ); } } - // Convert arterial pressure to mmHg if no fault - else if ( 0 == artPresAlarm ) -#else - if ( 0 == artPresAlarm ) -#endif - { - U08 artReadCtr = getFPGAArterialPressureReadCounter(); - U08 artErrorCtr = getFPGAArterialPressureErrorCounter(); - // Check for stale arterial pressure reading - // TODO I think we should check the change of the error count not if it is greater than 0? - if ( FALSE == isPersistentAlarmTriggered( ALARM_ID_HD_ARTERIAL_PRESSURE_READ_TIMEOUT_ERROR, ( lastArterialPressureReadCtr == artReadCtr || artErrorCtr > 0 ) ) ) +#ifndef _RELEASE_ + if ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_DVT_ARTERIAL_PRESSURE_SENSOR ) ) + { +#endif + if ( 0 == artPresAlarm ) { - arterialPressure.data = ARTERIAL_PRESSURE_V_PER_BIT * ( rawArterialPres / ( ARTERIAL_PRESSURE_SENSITIVITY * ARTERIAL_PRESSURE_V_BIAS ) ) + - getF32OverrideValue( &arterialPressureOffset ); + U08 artReadCtr = getFPGAArterialPressureReadCounter(); + U08 artErrorCtr = getFPGAArterialPressureErrorCounter(); + + + // Check for stale arterial pressure reading + // TODO I think we should check the change of the error count not if it is greater than 0? + if ( FALSE == isPersistentAlarmTriggered( ALARM_ID_HD_ARTERIAL_PRESSURE_READ_TIMEOUT_ERROR, ( lastArterialPressureReadCtr == artReadCtr || artErrorCtr > 0 ) ) ) + { + arterialPressure.data = ARTERIAL_PRESSURE_V_PER_BIT * ( rawArterialPres / ( ARTERIAL_PRESSURE_SENSITIVITY * ARTERIAL_PRESSURE_V_BIAS ) ) + + getF32OverrideValue( &arterialPressureOffset ); + } + else + { + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_ARTERIAL_PRESSURE_READ_TIMEOUT_ERROR, (U32)artErrorCtr ); + } + // Record arterial pressure sensor read counter for next time around + lastArterialPressureReadCtr = artReadCtr; } else { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_ARTERIAL_PRESSURE_READ_TIMEOUT_ERROR, (U32)artErrorCtr ); + #ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PRESSURE_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) + #endif + { + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT, (U32)artPresAlarm ) + } } - // Record arterial pressure sensor read counter for next time around - lastArterialPressureReadCtr = artReadCtr; } - else - { -#ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PRESSURE_CHECKS ) != SW_CONFIG_ENABLE_VALUE ) -#endif - { - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_ARTERIAL_PRESSURE_SENSOR_FAULT, (U32)artPresAlarm ) - } - } // Check for stale venous pressure reading if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_VENOUS_PRESSURE_READ_TIMEOUT_ERROR, ( lastVenousPressureReadCtr == venReadCtr ) ) )