Browse Source

Clear user control request handlers on set_configuration request.

pull/2/head
Gareth McMullin 14 years ago
parent
commit
f87170e06e
  1. 9
      lib/usb/usb_standard.c

9
lib/usb/usb_standard.c

@ -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…
Cancel
Save