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