[riot-notifications] [RIOT-OS/RIOT] [WIP] USBUS: Initial work towards an USB stack (#10916)

Koen Zandberg notifications at github.com
Mon Feb 11 11:25:45 CET 2019


bergzand commented on this pull request.



> +void _req_str(usbus_t *usbus, uint16_t idx)
+{
+    if (idx == 0) {
+        usb_descriptor_string_t desc;
+        desc.type = USB_TYPE_DESCRIPTOR_STRING;
+        desc.length = sizeof(uint16_t)+sizeof(usb_descriptor_string_t);
+        usbus_put_bytes(usbus, (uint8_t*)&desc, sizeof(desc));
+        /* Only one language ID supported */
+        uint16_t us = USB_CONFIG_DEFAULT_LANGID;
+        usbus_put_bytes(usbus, (uint8_t*)&us, sizeof(uint16_t));
+        usbus_ep0_ready(usbus);
+    }
+    else {
+        usb_descriptor_string_t desc;
+        desc.type = USB_TYPE_DESCRIPTOR_STRING;
+        mutex_lock(&usbus->lock);

These locks originate from the idea to have multiple threads interacting with the stack. I don't think that this was a very good idea, so for now it is one single thread and it should be possible to remove most if not all of these locks.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10916#discussion_r255446695
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190211/d99fcaa7/attachment.html>


More information about the notifications mailing list