mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
conditionally only do compass check if Mag is defined
This commit is contained in:
parent
8dacb1708f
commit
003bbc1511
1 changed files with 5 additions and 1 deletions
|
@ -180,7 +180,11 @@ bool positionControl(float deadband) {
|
||||||
return false; // cannot proceed without a GPS location
|
return false; // cannot proceed without a GPS location
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!canUseGPSHeading && !compassIsHealthy()) {
|
if (!canUseGPSHeading
|
||||||
|
#ifdef USE_MAG
|
||||||
|
&& !compassIsHealthy()
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
// If compass is healthy, we must have a Mag, and therefore are OK, even with no GPS Heading
|
// If compass is healthy, we must have a Mag, and therefore are OK, even with no GPS Heading
|
||||||
// If user allows posHold without a Mag, the IMU must be able to get heading from the GPS
|
// If user allows posHold without a Mag, the IMU must be able to get heading from the GPS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue