diff --git a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp index 9ca1220..759fdfa 100644 --- a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp +++ b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.cpp @@ -168,10 +168,13 @@ void MenuAutopilot::runCommand() const { break; case 7: - if (this->targetFreezed) + if (this->targetFreezed) { + this->targetFreezed = false; this->driveManager->getNavigation()->freezeTargetPoint(false); - else + } else { + this->targetFreezed = true; this->driveManager->getNavigation()->freezeTargetPoint(); + } break; default: diff --git a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h index 71c8ce3..7783f64 100644 --- a/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h +++ b/src/SpecialMenus/driveModi/Autopilot/menuAutopilot.h @@ -47,7 +47,7 @@ class MenuAutopilot : public MenuDriveMode { private: void init() override; - bool targetFreezed = false; + bool mutable targetFreezed = false; Autopilot* autopilot; RouteInfo routeInfo;