AntennaTracker: move control_mode_reason up to AP_Vehicle

This commit is contained in:
Peter Barker 2021-02-03 10:48:14 +11:00 committed by Andrew Tridgell
parent f15a1fbd62
commit ed4a61d5d9
1 changed files with 2 additions and 0 deletions

View File

@ -173,6 +173,8 @@ void Tracker::prepare_servos()
void Tracker::set_mode(Mode &newmode, const ModeReason reason)
{
control_mode_reason = reason;
if (mode == &newmode) {
// don't switch modes if we are already in the correct mode.
return;