summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/usb_drv.h7
-rw-r--r--firmware/usbstack/usb_core.c29
2 files changed, 11 insertions, 25 deletions
diff --git a/firmware/export/usb_drv.h b/firmware/export/usb_drv.h
index b5b5a7f065..7ef7c8b7ee 100644
--- a/firmware/export/usb_drv.h
+++ b/firmware/export/usb_drv.h
@@ -80,4 +80,11 @@ bool usb_drv_connected(void);
80int usb_drv_request_endpoint(int type, int dir); 80int usb_drv_request_endpoint(int type, int dir);
81void usb_drv_release_endpoint(int ep); 81void usb_drv_release_endpoint(int ep);
82 82
83/* USB_STRING_INITIALIZER(u"Example String") */
84#define USB_STRING_INITIALIZER(S) { \
85 sizeof(struct usb_string_descriptor) + sizeof(S) - sizeof(*S), \
86 USB_DT_STRING, \
87 S \
88}
89
83#endif /* _USB_DRV_H */ 90#endif /* _USB_DRV_H */
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index 038aef241f..3d187c8cab 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -120,43 +120,22 @@ static const struct usb_qualifier_descriptor __attribute__((aligned(2)))
120 120
121static const struct usb_string_descriptor __attribute__((aligned(2))) 121static const struct usb_string_descriptor __attribute__((aligned(2)))
122 usb_string_iManufacturer = 122 usb_string_iManufacturer =
123{ 123USB_STRING_INITIALIZER(u"Rockbox.org");
124 24,
125 USB_DT_STRING,
126 {'R', 'o', 'c', 'k', 'b', 'o', 'x', '.', 'o', 'r', 'g'}
127};
128 124
129static const struct usb_string_descriptor __attribute__((aligned(2))) 125static const struct usb_string_descriptor __attribute__((aligned(2)))
130 usb_string_iProduct = 126 usb_string_iProduct =
131{ 127USB_STRING_INITIALIZER(u"Rockbox media player");
132 42,
133 USB_DT_STRING,
134 {'R', 'o', 'c', 'k', 'b', 'o', 'x', ' ',
135 'm', 'e', 'd', 'i', 'a', ' ',
136 'p', 'l', 'a', 'y', 'e', 'r'}
137};
138 128
139static struct usb_string_descriptor __attribute__((aligned(2))) 129static struct usb_string_descriptor __attribute__((aligned(2)))
140 usb_string_iSerial = 130 usb_string_iSerial =
141{ 131USB_STRING_INITIALIZER(u"00000000000000000000000000000000000000000");
142 84,
143 USB_DT_STRING,
144 {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
145 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
146 '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
147 '0', '0', '0', '0', '0', '0', '0', '0'}
148};
149 132
150/* Generic for all targets */ 133/* Generic for all targets */
151 134
152/* this is stringid #0: languages supported */ 135/* this is stringid #0: languages supported */
153static const struct usb_string_descriptor __attribute__((aligned(2))) 136static const struct usb_string_descriptor __attribute__((aligned(2)))
154 lang_descriptor = 137 lang_descriptor =
155{ 138USB_STRING_INITIALIZER(u"\x0409"); /* LANGID US English */
156 4,
157 USB_DT_STRING,
158 {0x0409} /* LANGID US English */
159};
160 139
161static const struct usb_string_descriptor* const usb_strings[] = 140static const struct usb_string_descriptor* const usb_strings[] =
162{ 141{