mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +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
|
||||
}
|
||||
|
||||
if (!canUseGPSHeading && !compassIsHealthy()) {
|
||||
if (!canUseGPSHeading
|
||||
#ifdef USE_MAG
|
||||
&& !compassIsHealthy()
|
||||
#endif
|
||||
) {
|
||||
return false;
|
||||
// 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue