SDL: Don't wait a long time for zombie Bluetooth controllers

From 67fa6a935f05799a471a42601d9be19fc21f4c1c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 26 Sep 2022 20:49:26 -0700
Subject: [PATCH] Don't wait a long time for zombie Bluetooth controllers

If a Nintendo Switch Pro controller is turned off, it will leave the controller connected in Windows, but not responding to reports. Don't wait a really long time trying to get information from a controller in this state.
---
 src/joystick/hidapi/SDL_hidapi_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index 62e826c41e6..66feeab45dd 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -937,7 +937,7 @@ static ESwitchDeviceInfoControllerType
 ReadJoyConControllerType(SDL_HIDAPI_Device *device)
 {
     ESwitchDeviceInfoControllerType eControllerType = k_eSwitchDeviceInfoControllerType_Unknown;
-    const int MAX_ATTEMPTS = 20;
+    const int MAX_ATTEMPTS = 1; /* Don't try too long, in case this is a zombie Bluetooth controller */
     int attempts = 0;
 
     /* Create enough of a context to read the controller type from the device */