docs: usb: clarify usbd_register_control_callback()

Expand notes on when the control callbacks must be registered.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
This commit is contained in:
WGH 2018-01-04 19:23:17 +03:00 committed by Karl Palsson
parent c4cf904ef6
commit f59d47cbd1

View File

@ -121,8 +121,12 @@ typedef void (*usbd_endpoint_callback)(usbd_device *usbd_dev, uint8_t ep);
/* <usb_control.c> */
/** Registers a control callback.
*
* The specified callback will be called if (type == (bmRequestType
* & type_mask))
* Since the list of user control callbacks is cleared every time
* device configuration is set (inside usb_standard_set_configuration()),
* control callback registration must happen inside (or after) the
* config callback. The specified callback will be called if
* (type == (bmRequestType & type_mask)).
* @sa usbd_register_set_config_callback
* @param type Handled request type
* @param type_mask Mask to apply before matching request type
* @return 0 if successful