From 876d6adbe7e443009f33f00b862160c84d4034b1 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 11 Jan 2026 17:06:48 +0200 Subject: [PATCH] bdk: joycon: increase connection timeout to 1.8s --- bdk/input/joycon.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bdk/input/joycon.c b/bdk/input/joycon.c index 01b824f9..b6bc4344 100644 --- a/bdk/input/joycon.c +++ b/bdk/input/joycon.c @@ -557,6 +557,7 @@ static void _jc_conn_check() jc_l.connected = false; jc_l.rumble_sent = false; jc_l.charger_req = false; + jc_l.last_received_time = 0; jc_gamepad.conn_l = false; @@ -573,6 +574,7 @@ static void _jc_conn_check() jc_r.connected = false; jc_r.rumble_sent = false; jc_r.charger_req = false; + jc_r.last_received_time = 0; jc_gamepad.conn_r = false; @@ -1229,9 +1231,12 @@ static void _jc_init_conn(joycon_ctxt_t *jc) if (!jc->detected) return; - // Try to reinit if no input report. - // Actual connection timeout is 2000ms on official Joycon. - if (((u32)get_tmr_ms() - jc->last_received_time) > 1000) + /* + * Try to reinit if no input report. + * Actual connection timeout is 2000ms on official Joycon. + * Based on last JC_WIRED_CMD_HID_CONN/JC_WIRED_HID sent. + */ + if (((u32)get_tmr_ms() - jc->last_received_time) > 1800) { if (!jc->sio_mode) _jc_power_supply(jc->uart, true); @@ -1435,6 +1440,8 @@ void jc_deinit() if (!jc_init_done) return; + jc_init_done = false; + if (!jc_gamepad.sio_mode) { // Disable power.