AP_InertialSensor: added get_last_update_usec()

this will be used by the inter-EKF scheduling changes
This commit is contained in:
Andrew Tridgell 2017-04-29 10:26:58 +10:00
parent e78f55ef9b
commit e62fdad12c
2 changed files with 9 additions and 0 deletions

View File

@ -1257,6 +1257,8 @@ void AP_InertialSensor::update(void)
}
}
_last_update_usec = AP_HAL::micros();
_have_sample = false;
}

View File

@ -256,6 +256,10 @@ public:
void acal_update();
bool accel_cal_requires_reboot() const { return _accel_cal_requires_reboot; }
// return time in microseconds of last update() call
uint32_t get_last_update_usec(void) const { return _last_update_usec; }
private:
// load backend drivers
@ -396,6 +400,9 @@ private:
// time between samples in microseconds
uint32_t _sample_period_usec;
// last time update() completed
uint32_t _last_update_usec;
// health of gyros and accels
bool _gyro_healthy[INS_MAX_INSTANCES];
bool _accel_healthy[INS_MAX_INSTANCES];