Bläddra i källkod

Ignore spurious reply packets when reading Nintendo Switch controller reports

Sam Lantinga 10 månader sedan
förälder
incheckning
5ee9a840b1
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4 0
      src/joystick/hidapi/SDL_hidapi_switch.c

+ 4 - 0
src/joystick/hidapi/SDL_hidapi_switch.c

@@ -2525,6 +2525,10 @@ static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
             continue;
         }
 
+        if (ctx->m_rgucReadBuffer[0] == k_eSwitchInputReportIDs_SubcommandReply) {
+            continue;
+        }
+
         if (ctx->m_bInputOnly) {
             HandleInputOnlyControllerState(joystick, ctx, (SwitchInputOnlyControllerStatePacket_t *)&ctx->m_rgucReadBuffer[0]);
         } else {