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:
parent
15a373c1cd
commit
03b65b06b6
12 changed files with 136 additions and 161 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue