Browse Source

rollover is not a bug

subtracting unsigned numbers does the right thing
mission-4.1.18
Andrew Tridgell 13 years ago
parent
commit
bc9e943969
  1. 1
      libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp

1
libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp

@ -180,7 +180,6 @@ float AP_InertialSensor_MPU6000::temperature() { return _temp; } @@ -180,7 +180,6 @@ float AP_InertialSensor_MPU6000::temperature() { return _temp; }
uint32_t AP_InertialSensor_MPU6000::sample_time()
{
uint32_t us = micros();
/* XXX rollover creates a major bug */
uint32_t delta = us - _last_sample_micros;
reset_sample_time();
return delta;

Loading…
Cancel
Save