Skip to content

Commit

Permalink
Make sure we synchronously re-enable USB reporting mode for Switch co…
Browse files Browse the repository at this point in the history
…ntrollers (thanks @SortaCore!)

Fixes #3450

(cherry picked from commit b7c6fec)
  • Loading branch information
slouken committed Feb 8, 2023
1 parent 3fb9118 commit d77eb8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/joystick/hidapi/SDL_hidapi_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,11 @@ static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
const Uint32 INPUT_WAIT_TIMEOUT_MS = 100;
if (SDL_TICKS_PASSED(now, ctx->m_unLastInput + INPUT_WAIT_TIMEOUT_MS)) {
/* Steam may have put the controller back into non-reporting mode */
SDL_bool wasSyncWrite = ctx->m_bSyncWrite;

ctx->m_bSyncWrite = SDL_TRUE;
WriteProprietary(ctx, k_eSwitchProprietaryCommandIDs_ForceUSB, NULL, 0, SDL_FALSE);
ctx->m_bSyncWrite = wasSyncWrite;
}
} else if (device->is_bluetooth) {
const Uint32 INPUT_WAIT_TIMEOUT_MS = 3000;
Expand Down

0 comments on commit d77eb8a

Please sign in to comment.