Allow more than one usbd_register_set_config_callback

In a composite device if one want to separate code
for each interface, usbd_register_set_config_callback
can now register more than one callback.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
This commit is contained in:
Franck Jullien
2014-07-11 17:20:47 +02:00
committed by Frantisek Burian
parent 806ebb18fa
commit d6bad27735
2 changed files with 21 additions and 5 deletions

View File

@@ -39,6 +39,7 @@ LGPL License Terms @ref lgpl_license
#define __USB_PRIVATE_H
#define MAX_USER_CONTROL_CALLBACK 4
#define MAX_USER_SET_CONFIG_CALLBACK 4
#define MIN(a, b) ((a) < (b) ? (a) : (b))
@@ -85,8 +86,8 @@ struct _usbd_device {
void (*user_callback_ctr[8][3])(usbd_device *usbd_dev, uint8_t ea);
/* User callback function for some standard USB function hooks */
void (*user_callback_set_config)(usbd_device *usbd_dev,
uint16_t wValue);
void (*user_callback_set_config[MAX_USER_SET_CONFIG_CALLBACK])
(usbd_device *usbd_dev, uint16_t wValue);
const struct _usbd_driver *driver;