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

Koen Zandberg notifications at github.com
Thu Mar 28 22:28:45 CET 2019


bergzand commented on this pull request.



> +                break;
+        }
+    }
+    return NULL;
+}
+
+/* USB event callback */
+void _event_cb(usbdev_t *usbdev, usbdev_event_t event)
+{
+    usbus_t *usbus = (usbus_t *)usbdev->context;
+    if (event == USBDEV_EVENT_ESR) {
+        msg_t msg = { .type = USBUS_MSG_TYPE_EVENT,
+                      .content = { .ptr = usbdev } };
+
+        if (msg_send(&msg, usbus->pid) <= 0) {
+            puts("usbus: possibly lost interrupt.");

@kaspar030 I rewrote the loop to use thread flags. 2 flags are used as described above. Additionally I've added handling for `events` to allow signalling events to usb functionality from outside or inside the usbus thread.

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


More information about the notifications mailing list