rosflight / airbourne_f4

Be the Jason Bourne of the skies
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

VCP Driver #49

Open malioni opened 4 years ago

malioni commented 4 years ago

The VCP driver that is used seems to freeze some time after it starts printing at high frequencies. The time varies, my last two cases took 12 and 18 seconds to freeze but sometimes it takes longer. To test this, I commented out all of the lines that dealt with updating the magnetometer reading in /airbourne_f4/examples/i2c_mag/main.cpp file (while loop shown below) to just update and print a time value to the screen, and the values stop printing after a little while.

I have had times when I have done the same thing and the code runs for a long time (at least 30 min) without crashing, and sometimes it crashes fairly fast.

  uint32_t print_update = millis();
  while(1) 
  {
    // mag.update();
    // if (mag.present())
    // {
    //   warn.off();
    //   info.toggle();
    //   mag.read(mag_data);
    //   printf("%d, %d, %d\n",
    //          (int32_t)(mag_data[0]),
    //          (int32_t)(mag_data[1]),
    //          (int32_t)(mag_data[2]));
    // }
    // else 
    // {
    //   warn.on();
    //   printf("error\n");     
    // }
    // delay(10);
    printf("%d\n",print_update);
    print_update = millis();

  }
}