Index: firmware/App/Controllers/PresOccl.c =================================================================== diff -u -r7bbf1fb04f7e4788c3072ca173413ed052c608d3 -rc05775820109b5e83596c58a3b4248ac6cdb1d65 --- firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision 7bbf1fb04f7e4788c3072ca173413ed052c608d3) +++ firmware/App/Controllers/PresOccl.c (.../PresOccl.c) (revision c05775820109b5e83596c58a3b4248ac6cdb1d65) @@ -104,10 +104,13 @@ static U32 emptySalineBagCtr = 0; ///< Timer counter for empty bag detection. -static U08 lastVenousPressureReadCtr; ///< Previous venous pressure read counter. -static U08 lastBPOcclReadCtr; ///< Previous BP occlusion read counter. -static U08 lastDPiOcclReadCtr; ///< Previous DPi occlusion read counter. -static U08 lastDPoOcclReadCtr; ///< Previous DPo occlusion read counter. +static U08 lastVenousPressureReadCtr; ///< Previous venous pressure read count. +static U08 lastBPOcclReadCtr; ///< Previous BP occlusion read count. +static U08 lastDPiOcclReadCtr; ///< Previous DPi occlusion read count. +static U08 lastDPoOcclReadCtr; ///< Previous DPo occlusion read count. +static U08 lastBPErrorCtr; ///< Previous BP error count. +static U08 lastDPIErrorCtr; ///< Previous DPi error count. +static U08 lastDPOErrorCtr; ///< Previous DPo error count. // ********** private function prototypes ********** @@ -140,11 +143,17 @@ initPersistentAlarm( ALARM_ID_HD_BP_OCCLUSION_READ_TIMEOUT_ERROR, 0, PRES_ALARM_PERSISTENCE ); initPersistentAlarm( ALARM_ID_HD_DPI_OCCLUSON_READ_TIMEOUT_ERROR, 0, PRES_ALARM_PERSISTENCE ); initPersistentAlarm( ALARM_ID_HD_DPO_OCCLUSION_READ_TIMEOUT_ERROR, 0, PRES_ALARM_PERSISTENCE ); + initPersistentAlarm( ALARM_ID_HD_BP_OCCLUSION_SENSOR_ERROR, 0, PRES_ALARM_PERSISTENCE ); + initPersistentAlarm( ALARM_ID_HD_DPI_OCCLUSION_SENSOR_ERROR, 0, PRES_ALARM_PERSISTENCE ); + initPersistentAlarm( ALARM_ID_HD_DPO_OCCLUSION_SENSOR_ERROR, 0, PRES_ALARM_PERSISTENCE ); lastVenousPressureReadCtr = 0; lastBPOcclReadCtr = 0; lastDPiOcclReadCtr = 0; lastDPoOcclReadCtr = 0; + lastBPErrorCtr = 0; + lastDPIErrorCtr = 0; + lastDPOErrorCtr = 0; } /*********************************************************************//** @@ -325,7 +334,7 @@ else { #ifndef DISABLE_PRESSURE_CHECKS - SET_ALARM_WITH_1_U32_DATA( ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT, (U32)venPresStatus ) // TODO - persistence? +// SET_ALARM_WITH_1_U32_DATA( ALARM_ID_VENOUS_PRESSURE_SENSOR_FAULT, (U32)venPresStatus ) // TODO - persistence? YES, need persistence - getting a stale data status. OR maybe speed up ADC in FPGA. #endif } @@ -353,17 +362,16 @@ U08 dpiErrorCtr = getFPGADialInPumpOcclusionErrorCounter(); U08 dpoErrorCtr = getFPGADialOutPumpOcclusionErrorCounter(); -#ifndef DISABLE_FPGA_COUNTER_CHECKS // Check for sensor errors - if ( bpErrorCtr > 0 ) + if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_BP_OCCLUSION_SENSOR_ERROR, ( bpErrorCtr != lastBPErrorCtr ) ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_BP_OCCLUSION_SENSOR_ERROR, (U32)bpErrorCtr ) } - if ( dpiErrorCtr > 0 ) + if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DPI_OCCLUSION_SENSOR_ERROR, ( dpiErrorCtr != lastDPIErrorCtr ) ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_DPI_OCCLUSION_SENSOR_ERROR, (U32)dpiErrorCtr ) } - if ( dpoErrorCtr > 0 ) + if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_DPO_OCCLUSION_SENSOR_ERROR, ( dpoErrorCtr != lastDPOErrorCtr ) ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_DPO_OCCLUSION_SENSOR_ERROR, (U32)dpoErrorCtr ) } @@ -381,17 +389,19 @@ { activateAlarmNoData( ALARM_ID_HD_DPO_OCCLUSION_READ_TIMEOUT_ERROR ); } -#endif // Record occlusion sensor readings bloodPumpOcclusion.data = (U32)getFPGABloodPumpOcclusion(); dialInPumpOcclusion.data = (U32)getFPGADialInPumpOcclusion(); dialOutPumpOcclusion.data = (U32)getFPGADialOutPumpOcclusion(); - // Record occlusion read counters for next time around + // Record occlusion read and error counters for next time around lastBPOcclReadCtr = bpReadCtr; lastDPiOcclReadCtr = dpiReadCtr; lastDPoOcclReadCtr = dpoReadCtr; + lastBPErrorCtr = bpErrorCtr; + lastDPIErrorCtr = dpiErrorCtr; + lastDPOErrorCtr = dpoErrorCtr; } /*********************************************************************//**