USB: Work around FFB dropouts with modern wheels

Certain modern direct-drive wheels such as the Moza R5, R9, etc. implement
timeouts for FFB constant forces, and expect the forces to be re-run
rather than updated in order to refresh these timeouts.
This commit is contained in:
badfontkeming 2024-10-12 02:15:37 -05:00 committed by Ty
parent 69de95df8b
commit dafca1e264
1 changed files with 7 additions and 7 deletions

View File

@ -187,13 +187,13 @@ namespace usb_pad
Console.Warning("SDL_HapticUpdateEffect() for constant failed: %s", SDL_GetError()); Console.Warning("SDL_HapticUpdateEffect() for constant failed: %s", SDL_GetError());
} }
if (!m_constant_effect_running) // Always 'run' the constant force effect, even when already running. This
{ // mitigates FFB timeout issues experienced by some modern direct-drive
if (SDL_HapticRunEffect(m_haptic, m_constant_effect_id, SDL_HAPTIC_INFINITY) == 0) // wheels, such as Moza R5, R9, etc...
m_constant_effect_running = true; if (SDL_HapticRunEffect(m_haptic, m_constant_effect_id, SDL_HAPTIC_INFINITY) == 0)
else m_constant_effect_running = true;
Console.Error("SDL_HapticRunEffect() for constant failed: %s", SDL_GetError()); else
} Console.Error("SDL_HapticRunEffect() for constant failed: %s", SDL_GetError());
} }
template <typename T> template <typename T>