MPU6050 with BMP180

Hi, I am trying to get yaw, pitch and roll from MPU6050 and altitude from BMP180. When I run the code of each sensor separately I can get the data from the MPU6050 and from BMPU180. But when I try to get the data from those 2 sensors together it does not work. I mean, the arduino never outputs the altitude just the ywa, pitch and roll.

My really simple code is this below.

#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
#include "Wire.h"
MPU6050 mpu;
uint8_t mpuIntStatus;
uint16_t packetSize;
uint16_t fifoCount;
uint8_t fifoBuffer[64];
Quaternion q;
VectorFloat gravity;
float ypr[3];
volatile bool mpuInterrupt = false;
void dmpDataReady() {mpuInterrupt = true;}


#include "Wire.h"
#include "Adafruit_BMP085.h"
Adafruit_BMP085 bmp180;

void setup() {

  //Código do MPU6050.
    Wire.begin();
    TWBR = 24;
    mpu.initialize();
    mpu.dmpInitialize();
    mpu.setDMPEnabled(true);
    attachInterrupt(0, dmpDataReady, RISING);
    mpuIntStatus = mpu.getIntStatus();
    packetSize = mpu.dmpGetFIFOPacketSize();
    
    if (!bmp180.begin()) {
    
      Serial.println("BMP not found.");
    
      while (true) {}
        
    }

    Serial.begin(115200);
  
}

void loop() {

    while (!mpuInterrupt && fifoCount < packetSize) {

    Serial.print("Altitude:\t");
    Serial.println(bmp180.readAltitude());
       
    }

  //Código do MPU6050.
    mpuInterrupt = false;
    mpuIntStatus = mpu.getIntStatus();
    fifoCount = mpu.getFIFOCount();
    if ((mpuIntStatus & 0x10) || fifoCount == 1024) {
        mpu.resetFIFO();
        //COMENTAR_OFICIAL
        Serial.println(F("FIFO overflow!"));
    }
    else if (mpuIntStatus & 0x02) {
        while (fifoCount < packetSize) fifoCount = mpu.getFIFOCount();
        mpu.getFIFOBytes(fifoBuffer, packetSize);
        fifoCount -= packetSize;
        mpu.dmpGetQuaternion(&q, fifoBuffer);
        mpu.dmpGetGravity(&gravity, &q);
        mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
        
        Serial.print("ypr\t");
        Serial.print(ypr[0]*180/PI);
        Serial.print("\t");
        Serial.print(ypr[1]*180/PI);
        Serial.print("\t");
        Serial.print(ypr[2]*180/PI);
        Serial.println();

    }

}

I discovered something really strange: if I move this line

Serial.println(bmp180.readAltitude());

To right below the line:

mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);

It works fine. Why?

Actually it does not work fine, there are many fifo overflow messages when I change the line... but it at least looks to work.