relax hid host enumeration, allow set protocol to be stalled

This commit is contained in:
hathach 2023-03-21 18:12:55 +07:00
parent 096b6ec462
commit 878f2b54fe

View File

@ -465,8 +465,10 @@ bool hidh_set_config(uint8_t dev_addr, uint8_t itf_num)
static void process_set_config(tuh_xfer_t* xfer)
{
// Stall is a valid response for SET_IDLE, therefore we could ignore its result
if ( xfer->setup->bRequest != HID_REQ_CONTROL_SET_IDLE )
// Stall is a valid response for SET_IDLE, sometime SET_PROTOCOL as well
// therefore we could ignore its result
if ( !(xfer->setup->bRequest == HID_REQ_CONTROL_SET_IDLE ||
xfer->setup->bRequest == HID_REQ_CONTROL_SET_PROTOCOL) )
{
TU_ASSERT(xfer->result == XFER_RESULT_SUCCESS, );
}