Commit e7ee375f225631a96a3517113568ee6258be12a9

Sam Lantinga 2023-06-14T10:15:06

Fixed third-party Nintendo Switch Pro controllers shutting down when we try to set the home LED. This fixes the PDP Afterglow Wireless Deluxe Controller. (cherry picked from commit 0c16f4faf00eb573d051cac7d60ed8dd22e5596a)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index b7be08a..8b9d5e8 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -1041,6 +1041,11 @@ static SDL_bool HasHomeLED(SDL_DriverSwitch_Context *ctx)
         return SDL_FALSE;
     }
 
+    /* Third party controllers don't have a home LED and will shut off if we try to set it */
+    if (ctx->m_eControllerType == k_eSwitchDeviceInfoControllerType_LicProController) {
+        return SDL_FALSE;
+    }
+
     /* The Nintendo Online classic controllers don't have a Home LED */
     if (vendor_id == USB_VENDOR_NINTENDO &&
         ctx->m_eControllerType > k_eSwitchDeviceInfoControllerType_ProController) {