mirror of
https://github.com/sakumisu/CherryUSB.git
synced 2025-05-09 00:21:44 +08:00
fix(core/usbd_core): reset endpoint only for altsetting 0, refs:#258
This commit is contained in:
parent
76bbd09fed
commit
0d65bbc6ba
@ -489,10 +489,13 @@ static bool usbd_set_interface(uint8_t busid, uint8_t iface, uint8_t alt_setting
|
||||
if (cur_iface == iface) {
|
||||
ep_desc = (struct usb_endpoint_descriptor *)p;
|
||||
|
||||
if (cur_alt_setting != alt_setting) {
|
||||
if (alt_setting == 0) {
|
||||
ret = usbd_reset_endpoint(busid, ep_desc);
|
||||
} else {
|
||||
goto find_end;
|
||||
} else if (cur_alt_setting == alt_setting) {
|
||||
ret = usbd_set_endpoint(busid, ep_desc);
|
||||
goto find_end;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@ -510,6 +513,7 @@ static bool usbd_set_interface(uint8_t busid, uint8_t iface, uint8_t alt_setting
|
||||
}
|
||||
}
|
||||
|
||||
find_end:
|
||||
usbd_class_event_notify_handler(busid, USBD_EVENT_SET_INTERFACE, (void *)if_desc);
|
||||
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user