From 1e920e3e22ccf9dd0913efc3ab88cb08d7ab6273 Mon Sep 17 00:00:00 2001 From: Rustom Jehangir Date: Tue, 4 Oct 2016 17:58:37 -0700 Subject: [PATCH] SDL2: Force user to recalibrate on SDL2 update. --- src/Joystick/Joystick.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Joystick/Joystick.cc b/src/Joystick/Joystick.cc index e2975bb25..4c5fc64d9 100644 --- a/src/Joystick/Joystick.cc +++ b/src/Joystick/Joystick.cc @@ -19,7 +19,7 @@ QGC_LOGGING_CATEGORY(JoystickLog, "JoystickLog") QGC_LOGGING_CATEGORY(JoystickValuesLog, "JoystickValuesLog") const char* Joystick::_settingsGroup = "Joysticks"; -const char* Joystick::_calibratedSettingsKey = "Calibrated"; +const char* Joystick::_calibratedSettingsKey = "Calibrated1"; // Increment number to force recalibration const char* Joystick::_buttonActionSettingsKey = "ButtonActionName%1"; const char* Joystick::_throttleModeSettingsKey = "ThrottleMode"; const char* Joystick::_exponentialSettingsKey = "Exponential"; @@ -369,6 +369,11 @@ void Joystick::startPolling(Vehicle* vehicle) // Always set up the new vehicle _activeVehicle = vehicle; + // If joystick is not calibrated, disable it + if ( !_calibrated ) { + vehicle->setJoystickEnabled(false); + } + // Only connect the new vehicle if it wants joystick data if (vehicle->joystickEnabled()) { _pollingStartedForCalibration = false; -- 2.22.0