1
0
Fork 0
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:
ctzsnooze 2024-10-17 12:19:41 +11:00
parent 8dacb1708f
commit 003bbc1511

View file

@ -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