diff --git a/src/Joystick/Joystick.cc b/src/Joystick/Joystick.cc index e2975bb254b415c02f586f3f68a6d02330a0b643..4c5fc64d90a77c3cc61a9293075849adb2657b3d 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;