mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:49:51 +08:00
mpu9250 Fixed 'test' function causes register checking to find a false faults
Diisabled interrupts in reset to make command to reset atomic.
Added hold off of testing for register faults from the duration
of the test.
This commit is contained in:
committed by
Lorenz Meier
parent
15460ade77
commit
c3c5be3881
@@ -371,6 +371,12 @@ out:
|
||||
|
||||
int MPU9250::reset()
|
||||
{
|
||||
irqstate_t state;
|
||||
|
||||
// Hold off sampling for 60 ms
|
||||
state = px4_enter_critical_section();
|
||||
_reset_wait = hrt_absolute_time() + 60000;
|
||||
|
||||
write_reg(MPUREG_PWR_MGMT_1, BIT_H_RESET);
|
||||
up_udelay(10000);
|
||||
|
||||
@@ -380,6 +386,14 @@ int MPU9250::reset()
|
||||
write_checked_reg(MPUREG_PWR_MGMT_2, 0);
|
||||
up_udelay(1000);
|
||||
|
||||
px4_leave_critical_section(state);
|
||||
|
||||
// Hold off sampling for 30 ms
|
||||
|
||||
state = px4_enter_critical_section();
|
||||
_reset_wait = hrt_absolute_time() + 30000;
|
||||
px4_leave_critical_section(state);
|
||||
|
||||
// SAMPLE RATE
|
||||
_set_sample_rate(_sample_rate);
|
||||
usleep(1000);
|
||||
|
||||
Reference in New Issue
Block a user