1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

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:
Damjan Adamic 2017-03-07 22:59:32 +01:00 committed by Bertrand Songis
parent 15a373c1cd
commit 03b65b06b6
12 changed files with 136 additions and 161 deletions

View file

@ -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)
}