Skip to content

Commit

Permalink
Fixed third party Nintendo Switch Pro Controller resetting when being…
Browse files Browse the repository at this point in the history
… sent an unsupported command to set the Home LED

Tested with the PowerA Fusion Pro Wireless Controller in Bluetooth mode
  • Loading branch information
slouken committed Jun 14, 2023
1 parent 8c95bd8 commit 23e007d
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 @@ -1596,6 +1596,10 @@ static int HIDAPI_DriverSwitch_SendJoystickEffect(SDL_HIDAPI_Device *device, SDL
/* Going into simple mode over USB disables input reports, so don't do that */
return 0;
}
if (cmd == k_eSwitchSubcommandIDs_SetHomeLight && !HasHomeLED(ctx)) {
/* Setting the home LED when it's not supported can cause the controller to reset */
return 0;
}

if (!WriteSubcommand(ctx, cmd, &payload[1], (Uint8)(size - 1), NULL)) {
return -1;
Expand Down

0 comments on commit 23e007d

Please sign in to comment.