aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3
diff options
context:
space:
mode:
authorAndrey Smirnov2012-11-06 16:46:55 -0800
committerAndrey Smirnov2012-11-06 16:46:55 -0800
commit7a5da60e2669c57d7b615aabe16ab851606f8bf1 (patch)
treebd28597a5b20d7f21379cd3640898ac58a57d3a3 /include/libopencm3
parent74405de4a5a1beab4023731de41c9f6e1c7f69a4 (diff)
Change USB strings handling code
This commit add an extra field to the _usbd_device, that allows to keep track of the number of USB strings which allows simplify boundaries checking code in usb_standard_get_descriptor. This commit also changes the index base for strings in usb_standard_get_descriptor which allows to get rid of necessity to have a dummy one-character string in a strings array.
Diffstat (limited to 'include/libopencm3')
-rw-r--r--include/libopencm3/usb/usbd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libopencm3/usb/usbd.h b/include/libopencm3/usb/usbd.h
index e4b3578..9da8379 100644
--- a/include/libopencm3/usb/usbd.h
+++ b/include/libopencm3/usb/usbd.h
@@ -38,7 +38,7 @@ extern u8 usbd_control_buffer[];
extern int usbd_init(const usbd_driver *driver,
const struct usb_device_descriptor *dev,
const struct usb_config_descriptor *conf,
- const char **strings);
+ const char **strings, int num_strings);
extern void usbd_set_control_buffer_size(u16 size);
extern void usbd_register_reset_callback(void (*callback)(void));