Index: firmware/App/Controllers/Pressures.c =================================================================== diff -u -r721bd715bef050760e5c0f79044d1cba642c8354 -rde18b3784a9a5ab48d11cb6ce2c651de390ee0e9 --- firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision 721bd715bef050760e5c0f79044d1cba642c8354) +++ firmware/App/Controllers/Pressures.c (.../Pressures.c) (revision de18b3784a9a5ab48d11cb6ce2c651de390ee0e9) @@ -458,13 +458,21 @@ break; case PRESSURE_SENSOR_BAROMETRIC: - baroConvConsts.pressureSensitivity = getFPGABaroPressureSensitivity(); - baroConvConsts.pressureSensitivityTempCoeff = getFPGABaroTempCoeffOfPressSensitvity(); - baroConvConsts.pressureOffset = getFPGABaroPressureOffset(); - baroConvConsts.pressureOffsetTempCoeff = getFPGABaroTempCoeffOfPressOffset(); - pressureBeforeCal = calculateBaroPressure( (U32)adcSum ); - pressures[ sensorId ].data = getCalibrationAppliedPressure( sensorId, pressureBeforeCal ); - msrdPressureSum[ sensorId ] = 0; + { + DG_OP_MODE_T opMode = getCurrentOperationMode(); + // Do not read the barometric pressure in treatment modes. + // Baro pressure is not read during treatment and it keeps the value that it was last read prior to treatment modes. + if ( ( opMode != DG_MODE_GENE ) && ( opMode != DG_MODE_FILL ) && ( opMode != DG_MODE_DRAI ) ) + { + baroConvConsts.pressureSensitivity = getFPGABaroPressureSensitivity(); + baroConvConsts.pressureSensitivityTempCoeff = getFPGABaroTempCoeffOfPressSensitvity(); + baroConvConsts.pressureOffset = getFPGABaroPressureOffset(); + baroConvConsts.pressureOffsetTempCoeff = getFPGABaroTempCoeffOfPressOffset(); + pressureBeforeCal = calculateBaroPressure( (U32)adcSum ); + pressures[ sensorId ].data = getCalibrationAppliedPressure( sensorId, pressureBeforeCal ); + msrdPressureSum[ sensorId ] = 0; + } + } break; #ifndef _VECTORCAST_ @@ -613,10 +621,16 @@ case PRESSURE_SENSOR_BAROMETRIC: if ( baroConvConsts.pressureSensitivity != 0 ) { - // Check the baro and alarm if out of range. Make sure the conversion coefficients of the sensor has been read and received from FPGA - pressureReading = getBaroPressurePSI(); - isBaroOutOfRange = ( ( pressureReading < MIN_VALID_BARO_PRESSURE_PSIA ) || ( pressureReading > MAX_VALID_BARO_PRESSURE_PSIA ) ? TRUE : FALSE ); - checkPersistentAlarm( ALARM_ID_DG_BARO_PRESSURE_OUT_OF_RANGE, isBaroOutOfRange, (F32)sensorId, pressureReading ); + DG_OP_MODE_T opMode = getCurrentOperationMode(); + + // Do not check the barometric pressure during the treatment modes. + if ( ( opMode != DG_MODE_GENE ) && ( opMode != DG_MODE_FILL ) && ( opMode != DG_MODE_DRAI ) ) + { + // Check the baro and alarm if out of range. Make sure the conversion coefficients of the sensor has been read and received from FPGA + pressureReading = getBaroPressurePSI(); + isBaroOutOfRange = ( ( pressureReading < MIN_VALID_BARO_PRESSURE_PSIA ) || ( pressureReading > MAX_VALID_BARO_PRESSURE_PSIA ) ? TRUE : FALSE ); + checkPersistentAlarm( ALARM_ID_DG_BARO_PRESSURE_OUT_OF_RANGE, isBaroOutOfRange, (F32)sensorId, pressureReading ); + } } break;