mirror of https://github.com/ArduPilot/ardupilot
AP_Compass: LSM303D: check for overruns in compass values
This commit is contained in:
parent
cf2d866d51
commit
46936767c1
|
@ -236,6 +236,11 @@ bool AP_Compass_LSM303D::_read_sample()
|
|||
return false;
|
||||
}
|
||||
|
||||
/* check for overrun */
|
||||
if ((rx.status & 0x70) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_zero(rx.x) && is_zero(rx.y) && is_zero(rx.z)) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue