rollover is not a bug

subtracting unsigned numbers does the right thing
This commit is contained in:
Andrew Tridgell 2011-12-21 15:31:11 +11:00
parent eec5f000b5
commit eac625ba8f

View File

@ -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;