Skip to content

Commit 878f2b5

Browse files
committed
relax hid host enumeration, allow set protocol to be stalled
1 parent 096b6ec commit 878f2b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/class/hid/hid_host.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,10 @@ bool hidh_set_config(uint8_t dev_addr, uint8_t itf_num)
465465

466466
static void process_set_config(tuh_xfer_t* xfer)
467467
{
468-
// Stall is a valid response for SET_IDLE, therefore we could ignore its result
469-
if ( xfer->setup->bRequest != HID_REQ_CONTROL_SET_IDLE )
468+
// Stall is a valid response for SET_IDLE, sometime SET_PROTOCOL as well
469+
// therefore we could ignore its result
470+
if ( !(xfer->setup->bRequest == HID_REQ_CONTROL_SET_IDLE ||
471+
xfer->setup->bRequest == HID_REQ_CONTROL_SET_PROTOCOL) )
470472
{
471473
TU_ASSERT(xfer->result == XFER_RESULT_SUCCESS, );
472474
}

0 commit comments

Comments
 (0)