From 27b02d66aa875b7a0d9f37450fed4d3dea35b8bf Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Mon, 19 Jul 2021 16:59:41 +1000 Subject: [PATCH] (Wii U) Ignore some bogus KPAD results This API is completely bonkers, seems to have no idea what the error conditions are --- input/drivers_joypad/wiiu/kpad_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/input/drivers_joypad/wiiu/kpad_driver.c b/input/drivers_joypad/wiiu/kpad_driver.c index 2d7a36a4f4..0466975b5f 100644 --- a/input/drivers_joypad/wiiu/kpad_driver.c +++ b/input/drivers_joypad/wiiu/kpad_driver.c @@ -251,6 +251,12 @@ static void kpad_poll(void) } poll_failures[channel] = 0; + /* Several reads when a device is connected or an attachment added give */ + /* bogus results, try to weed them out */ + if (kpad.wpad_error || kpad.device_type == 255) { + continue; + } + kpad_poll_one_channel(channel, &kpad); } }