Skip to content

[NAV/MIXER] Refactor getMotorStop() code for better readability#6305

Merged
digitalentity merged 1 commit intomasterfrom
de_motor_status_refactor
Nov 16, 2020
Merged

[NAV/MIXER] Refactor getMotorStop() code for better readability#6305
digitalentity merged 1 commit intomasterfrom
de_motor_status_refactor

Conversation

@digitalentity
Copy link
Member

Due to a multi-level logic condition in getMotorStop() we missed the fact that in certain configuration getMotorStop() and navigationIsControllingThrottle() could call each other in an infinite loop causing a crash when entering a navigation mode that controls throttle.

Logic is now changed by creating a separate function navigationInAutomaticThrottleMode() to probe if our Navigation core is in mode that may be controlling throttle, provided mixer allows that. navigationIsControllingThrottle() now correctly evaluates if the Navigation core is indeed in control of motor throttle.

Fixes #6296

…hen nav_overrides_motor_stop is set to NOMS_ALL_NAV
@digitalentity digitalentity force-pushed the de_motor_status_refactor branch from 068b746 to 94332bc Compare November 16, 2020 19:47
@digitalentity
Copy link
Member Author

Fix confirmed on the platform where it was originally revealed.

@digitalentity digitalentity merged commit b17d8a2 into master Nov 16, 2020
@digitalentity digitalentity deleted the de_motor_status_refactor branch November 16, 2020 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.6.0 - Critical bug in launch mode

1 participant