mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Compass: fix AK09916 hangup issue
This commit is contained in:
parent
58281108c0
commit
852a508a8d
@ -311,8 +311,15 @@ void AP_Compass_AK09916::_update()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(regs.st1 & 0x01)) {
|
if (!(regs.st1 & 0x01)) {
|
||||||
|
no_data++;
|
||||||
|
if (no_data == 5) {
|
||||||
|
_reset();
|
||||||
|
_setup_mode();
|
||||||
|
no_data = 0;
|
||||||
|
}
|
||||||
goto check_registers;
|
goto check_registers;
|
||||||
}
|
}
|
||||||
|
no_data = 0;
|
||||||
|
|
||||||
/* Check for overflow. See AK09916's datasheet*/
|
/* Check for overflow. See AK09916's datasheet*/
|
||||||
if ((regs.st2 & 0x08)) {
|
if ((regs.st2 & 0x08)) {
|
||||||
|
@ -97,6 +97,7 @@ private:
|
|||||||
bool _initialized;
|
bool _initialized;
|
||||||
enum Rotation _rotation;
|
enum Rotation _rotation;
|
||||||
enum AP_Compass_Backend::DevTypes _devtype;
|
enum AP_Compass_Backend::DevTypes _devtype;
|
||||||
|
uint8_t no_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user