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

Koen Zandberg notifications at github.com
Thu May 30 21:10:57 CEST 2019


bergzand commented on this pull request.



> +        uint16_t us = USB_CONFIG_DEFAULT_LANGID;
+        usbus_control_slicer_put_bytes(usbus, (uint8_t *)&us, sizeof(uint16_t));
+    }
+    else {
+        usb_descriptor_string_t desc;
+        desc.type = USB_TYPE_DESCRIPTOR_STRING;
+        usbus_string_t *str = _get_descriptor(usbus, idx);
+        if (str) {
+            desc.length = sizeof(usb_descriptor_string_t);
+            desc.length += 2 * strlen(str->str); /* USB strings are UTF-16 */
+            usbus_control_slicer_put_bytes(usbus, (uint8_t *)&desc,
+                                           sizeof(desc));
+            _cpy_str_to_utf16(usbus, str->str);
+        }
+    }
+    return 1;

Fixed function to also be able to  return `-1` in some cases

-- 
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_r289131121
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190530/be4e3af4/attachment.html>


More information about the notifications mailing list