1
0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-25 15:17:19 +00:00

bdk: joycon: fixup hori pads

For Hori game pads:
- Restore the no power down fix
- Revert RTS signal back to active high
This commit is contained in:
CTCaer 2022-07-01 13:47:41 +03:00
parent fe7fd6370e
commit b787053c2d

View File

@ -633,7 +633,8 @@ static void _jc_parse_wired_hid(joycon_ctxt_t *jc, const u8* packet, u32 size)
jc_gamepad.conn_l = jc_l.connected;
jc_gamepad.conn_r = jc_r.connected;
_jc_charging_decider(hid_pkt->batt_info, jc->uart);
if (hid_pkt->cmd == JC_HID_INPUT_RPT)
_jc_charging_decider(hid_pkt->batt_info, jc->uart);
break;
case JC_HID_SUBMCD_RPT:
if (hid_pkt->subcmd == JC_HID_SUBCMD_SPI_READ)
@ -1088,6 +1089,8 @@ static void _jc_init_conn(joycon_ctxt_t *jc)
msleep(2);
_jc_rcv_pkt(jc);
}
else // Hori. Unset RTS inversion.
uart_invert(jc->uart, false, UART_INVERT_RTS);
}
else
{
@ -1127,7 +1130,7 @@ static void _jc_init_conn(joycon_ctxt_t *jc)
out:
jc->last_received_time = get_tmr_ms();
if (!jc->sio_mode && jc->connected)
if (!jc->sio_mode && jc->connected && !(jc->type & JC_ID_HORI))
_jc_power_supply(jc->uart, false);
}
}