Index: firmware/App/Controllers/Pressures.c =================================================================== diff -u -r6499ea25921fcf67826fa0c35bb03caf411ba542 -r44459c11d7f3d39967b3eb6ec284403358d6a287 --- firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 6499ea25921fcf67826fa0c35bb03caf411ba542) +++ firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 44459c11d7f3d39967b3eb6ec284403358d6a287) @@ -546,12 +546,13 @@ static void monitorPressureSensors( void ) { U08 sensorId; - BOOL isPressureOutOfRange = FALSE; - BOOL isCurrentPressureOut = FALSE; - BOOL isBaroOutOfRange = FALSE; - F32 pressureOutID = 0.0F; F32 pressureReading = 0.0F; + BOOL isBaroOutOfRange = FALSE; + BOOL isPressureOutOfRange = FALSE; + U08 alarmID = 0.0F; + F32 alarmPressure = 0.0F; + for ( sensorId = 0; sensorId < NUM_OF_PRESSURE_SENSORS; sensorId++ ) { switch ( sensorId ) @@ -566,9 +567,12 @@ // Remember the ID of the pressure sensor that is out of range. The ID is converted to float since the check persistent alarm function // accepts only floats. pressureReading = getMeasuredDGPressure( sensorId ) + getBaroPressurePSI(); - isCurrentPressureOut = ( ( pressureReading < MIN_VALID_PRESSURE_RANGE_PSIA ) || ( pressureReading > MAX_VALID_PRESSURE_RANGE_PSIA ) ? TRUE : FALSE ); - isPressureOutOfRange |= isCurrentPressureOut; - pressureOutID = ( TRUE == isCurrentPressureOut ? (F32)sensorId : pressureOutID ); + if ( ( pressureReading < MIN_VALID_PRESSURE_RANGE_PSIA ) || ( pressureReading > MAX_VALID_PRESSURE_RANGE_PSIA ) ) + { + isPressureOutOfRange = TRUE; + alarmID = sensorId; + alarmPressure = pressureReading; + } break; case PRESSURE_SENSOR_BAROMETRIC: @@ -590,7 +594,7 @@ } // Once the sensors were all checked to be out of range, check the persistent alarm - checkPersistentAlarm( ALARM_ID_DG_PRESSURE_OUT_OF_RANGE, isPressureOutOfRange, pressureOutID, pressureReading ); + checkPersistentAlarm( ALARM_ID_DG_PRESSURE_OUT_OF_RANGE, isPressureOutOfRange, alarmID, alarmPressure ); }