Clear user control request handlers on set_configuration request.
This commit is contained in:
parent
59293a9640
commit
f87170e06e
|
@ -150,8 +150,15 @@ static int usb_standard_set_configuration(struct usb_setup_data *req,
|
|||
/* Reset all endpoints. */
|
||||
_usbd_hw_endpoints_reset();
|
||||
|
||||
if (_usbd_device.user_callback_set_config)
|
||||
if (_usbd_device.user_callback_set_config) {
|
||||
/* Flush control callbacks. These will be reregistered
|
||||
* by the user handler. */
|
||||
int i;
|
||||
for(i = 0; i < MAX_USER_CONTROL_CALLBACK; i++)
|
||||
_usbd_device.user_control_callback[i].cb = NULL;
|
||||
|
||||
_usbd_device.user_callback_set_config(req->wValue);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue