1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

fix failure to initiate position hold from error in ifdef

This commit is contained in:
ctzsnooze 2024-10-19 10:45:24 +11:00
parent bf7cff3c4c
commit 8641fcd291
4 changed files with 16 additions and 13 deletions

View file

@ -201,10 +201,11 @@ bool positionControl(bool useStickAdjustment, float deadband) {
posHold.previousDistanceCm = posHold.distanceCm;
}
}
const uint8_t startLogger = posHold.justStarted ? 2 : 1;
DEBUG_SET(DEBUG_AUTOPILOT_POSITION, 3, startLogger);
// simple (very simple) sanity check
// ** simple (too simple) sanity check **
// primarily to detect flyaway from no Mag or badly oriented Mag
// TODO - maybe figure how to make a better check by giving more leeway at the start?
if (posHold.distanceCm > 1000) {