aboutsummaryrefslogtreecommitdiff
path: root/lib/usb/usb_private.h
diff options
context:
space:
mode:
authorGareth McMullin2010-11-06 12:21:46 +1300
committerGareth McMullin2010-11-06 12:21:46 +1300
commit7f002110dcccf7efb8c260bdc2106c2192257c96 (patch)
tree1fb74639fa96bd550e8dd9b018298255dde033cd /lib/usb/usb_private.h
parent5bba6d92068f869c880d8fe59712343146f63391 (diff)
Improved dispatching of user control callbacks.
Only cdc_acm example is updated.
Diffstat (limited to 'lib/usb/usb_private.h')
-rw-r--r--lib/usb/usb_private.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/usb/usb_private.h b/lib/usb/usb_private.h
index 6cbc576..6c7e073 100644
--- a/lib/usb/usb_private.h
+++ b/lib/usb/usb_private.h
@@ -21,6 +21,8 @@
#ifndef __USB_PRIVATE_H
#define __USB_PRIVATE_H
+#define MAX_USER_CONTROL_CALLBACK 4
+
#define MIN(a, b) ((a)<(b) ? (a) : (b))
/** Internal collection of device information. */
@@ -42,14 +44,11 @@ extern struct _usbd_device {
void (*user_callback_suspend)(void);
void (*user_callback_resume)(void);
- int (*user_callback_control_command)(struct usb_setup_data *req,
- void (**complete)(struct usb_setup_data *req));
- int (*user_callback_control_read)(struct usb_setup_data *req,
- uint8_t **buf, uint16_t *len,
- void (**complete)(struct usb_setup_data *req));
- int (*user_callback_control_write)(struct usb_setup_data *req,
- uint8_t *buf, uint16_t len,
- void (**complete)(struct usb_setup_data *req));
+ struct user_control_callback {
+ usbd_control_callback cb;
+ uint8_t type;
+ uint8_t type_mask;
+ } user_control_callback[MAX_USER_CONTROL_CALLBACK];
void (*user_callback_ctr[8][3])(uint8_t ea);