Projectkk2glider/issue 4479 slow joystick (#4569)
* Missing debug timer * USB driver cleanup * Re #4479: Joystick update called from mixer thread every 10ms * Cosmetics * Compilation fix * Cosmetics * Another compilation fix
This commit is contained in:
committed by
Bertrand Songis
parent
15a373c1cd
commit
03b65b06b6
+2
-13
@@ -27,30 +27,19 @@ uint8_t mainRequestFlags = 0;
|
||||
void handleUsbConnection()
|
||||
{
|
||||
#if defined(STM32) && !defined(SIMU)
|
||||
static bool usbStarted = false;
|
||||
|
||||
if (!usbStarted && usbPlugged()) {
|
||||
usbStarted = true;
|
||||
if (!usbStarted() && usbPlugged()) {
|
||||
usbStart();
|
||||
#if defined(USB_MASS_STORAGE)
|
||||
opentxClose(false);
|
||||
usbPluggedIn();
|
||||
#endif
|
||||
}
|
||||
if (usbStarted && !usbPlugged()) {
|
||||
usbStarted = false;
|
||||
if (usbStarted() && !usbPlugged()) {
|
||||
usbStop();
|
||||
#if defined(USB_MASS_STORAGE) && !defined(EEPROM)
|
||||
opentxResume();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(USB_JOYSTICK)
|
||||
if (usbStarted ) {
|
||||
usbJoystickUpdate();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // defined(STM32) && !defined(SIMU)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user