mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 00:31:36 +08:00
new mpu6000/mpu6500/mpu9250 always schedule backup cycle if using data ready
This commit is contained in:
@@ -188,10 +188,13 @@ void MPU6000::RunImpl()
|
||||
case STATE::FIFO_READ: {
|
||||
hrt_abstime timestamp_sample = 0;
|
||||
|
||||
if (_data_ready_interrupt_enabled && (hrt_elapsed_time(×tamp_sample) < (_fifo_empty_interval_us / 2))) {
|
||||
if (_data_ready_interrupt_enabled) {
|
||||
// re-schedule as watchdog timeout
|
||||
ScheduleDelayed(10_ms);
|
||||
}
|
||||
|
||||
if (_data_ready_interrupt_enabled && (hrt_elapsed_time(×tamp_sample) < (_fifo_empty_interval_us / 2))) {
|
||||
// use timestamp from data ready interrupt if enabled and seems valid
|
||||
timestamp_sample = _fifo_watermark_interrupt_timestamp;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -188,10 +188,13 @@ void MPU6500::RunImpl()
|
||||
case STATE::FIFO_READ: {
|
||||
hrt_abstime timestamp_sample = 0;
|
||||
|
||||
if (_data_ready_interrupt_enabled && (hrt_elapsed_time(×tamp_sample) < (_fifo_empty_interval_us / 2))) {
|
||||
if (_data_ready_interrupt_enabled) {
|
||||
// re-schedule as watchdog timeout
|
||||
ScheduleDelayed(10_ms);
|
||||
}
|
||||
|
||||
if (_data_ready_interrupt_enabled && (hrt_elapsed_time(×tamp_sample) < (_fifo_empty_interval_us / 2))) {
|
||||
// use timestamp from data ready interrupt if enabled and seems valid
|
||||
timestamp_sample = _fifo_watermark_interrupt_timestamp;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -221,10 +221,13 @@ void MPU9250::RunImpl()
|
||||
case STATE::FIFO_READ: {
|
||||
hrt_abstime timestamp_sample = 0;
|
||||
|
||||
if (_data_ready_interrupt_enabled && (hrt_elapsed_time(×tamp_sample) < (_fifo_empty_interval_us / 2))) {
|
||||
if (_data_ready_interrupt_enabled) {
|
||||
// re-schedule as watchdog timeout
|
||||
ScheduleDelayed(10_ms);
|
||||
}
|
||||
|
||||
if (_data_ready_interrupt_enabled && (hrt_elapsed_time(×tamp_sample) < (_fifo_empty_interval_us / 2))) {
|
||||
// use timestamp from data ready interrupt if enabled and seems valid
|
||||
timestamp_sample = _fifo_watermark_interrupt_timestamp;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user