SDL: let through a SetLED command every 5sec to deall with situations where the controller loses power when a computer is suspended

CR: SamL
This commit is contained in:
Sam Lantinga
2021-04-12 11:25:42 -07:00
parent c59d4dcd38
commit 2a20cc0f1d
2 changed files with 14 additions and 5 deletions

View File

@@ -99,6 +99,7 @@ struct _SDL_Joystick
Uint8 led_red;
Uint8 led_green;
Uint8 led_blue;
Uint32 led_expiration;
SDL_bool attached;
SDL_bool is_game_controller;
@@ -189,6 +190,8 @@ typedef struct _SDL_JoystickDriver
/* Windows and Mac OSX has a limit of MAX_DWORD / 1000, Linux kernel has a limit of 0xFFFF */
#define SDL_MAX_RUMBLE_DURATION_MS 0xFFFF
#define SDL_LED_MIN_REPEAT_MS 5000
/* The available joystick drivers */
extern SDL_JoystickDriver SDL_ANDROID_JoystickDriver;
extern SDL_JoystickDriver SDL_BSD_JoystickDriver;