mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-20 14:55:18 +03:00
Update navigation.c
Fix ABS build error
This commit is contained in:
parent
1b3ebd4475
commit
b3005fbc3c
1 changed files with 4 additions and 2 deletions
|
@ -2526,12 +2526,14 @@ static void rthAltControlStickOverrideCheck(unsigned axis)
|
|||
}
|
||||
|
||||
static timeMs_t rthOverrideStickHoldStartTime[2];
|
||||
timeMs_t currentTime = millis();
|
||||
|
||||
if (rxGetChannelValue(axis) > rxConfig()->maxcheck) {
|
||||
|
||||
timeDelta_t holdTime = millis() - rthOverrideStickHoldStartTime[axis];
|
||||
|
||||
if (!rthOverrideStickHoldStartTime[axis]) {
|
||||
rthOverrideStickHoldStartTime[axis] = millis();
|
||||
} else if (ABS(2500 - (currentTime - rthOverrideStickHoldStartTime[axis])) < 500) {
|
||||
} else if (ABS(2500 - holdTime) < 500) {
|
||||
if (axis == PITCH) { // pitch down to override preset altitude reset to current altitude
|
||||
posControl.rthState.rthInitialAltitude = posControl.actualState.abs.pos.z;
|
||||
posControl.rthState.rthFinalAltitude = posControl.rthState.rthInitialAltitude;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue