Clear user control request handlers on set_configuration request.

This commit is contained in:
Gareth McMullin 2011-01-30 15:41:23 +13:00
parent 59293a9640
commit f87170e06e
1 changed files with 8 additions and 1 deletions

View File

@ -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;
}