Commit e9bc21fba5ac35cab335ea09baad8c5acb4a7bf9

Sam Lantinga 2020-03-04T17:10:37

Fixed rumble for third-party Nintento Switch Pro controllers The 8BitDo SF30 Pro Gamepad will generate a single motor pulse for each rumble message, so we need to do this frequently to have continous rumble on this device.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index cf94e90..8e25657 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -455,7 +455,7 @@ static SDL_bool WriteRumble(SDL_DriverSwitch_Context *ctx)
 
     /* Refresh the rumble state periodically */
     if (ctx->m_bRumbleActive) {
-        ctx->m_unRumbleRefresh = SDL_GetTicks() + 1000;
+        ctx->m_unRumbleRefresh = SDL_GetTicks() + 30;
         if (!ctx->m_unRumbleRefresh) {
             ctx->m_unRumbleRefresh = 1;
         }