mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 13:25:33 +00:00
joystick: Fix spurious battery empty events when opening a Shield controller
This commit is contained in:
parent
a0d8848baa
commit
b321eae51a
|
@ -155,6 +155,7 @@ HIDAPI_DriverShield_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joysti
|
||||||
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;
|
joystick->epowerlevel = SDL_JOYSTICK_POWER_UNKNOWN;
|
||||||
|
|
||||||
/* Request battery and charging info */
|
/* Request battery and charging info */
|
||||||
|
ctx->battery_level = SDL_JOYSTICK_POWER_UNKNOWN;
|
||||||
ctx->last_battery_query_time = SDL_GetTicks();
|
ctx->last_battery_query_time = SDL_GetTicks();
|
||||||
HIDAPI_DriverShield_SendCommand(device, CMD_CHARGE_STATE, NULL, 0);
|
HIDAPI_DriverShield_SendCommand(device, CMD_CHARGE_STATE, NULL, 0);
|
||||||
HIDAPI_DriverShield_SendCommand(device, CMD_BATTERY_STATE, NULL, 0);
|
HIDAPI_DriverShield_SendCommand(device, CMD_BATTERY_STATE, NULL, 0);
|
||||||
|
|
Loading…
Reference in a new issue