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

Koen Zandberg notifications at github.com
Thu May 30 20:38:48 CEST 2019


bergzand commented on this pull request.



> +}
+
+/* USB endpoint 0 callback */
+static void _handler_ep0_event(usbus_t *usbus, usbus_handler_t *handler,
+                              usbus_event_usb_t event)
+{
+    usbus_control_handler_t *ep0_handler = (usbus_control_handler_t *)handler;
+
+    (void)usbus;
+    switch (event) {
+        case USBUS_EVENT_USB_RESET:
+            DEBUG("usbus_control: Reset event triggered\n");
+            ep0_handler->setup_state = USBUS_SETUPRQ_READY;
+            _usbus_config_ep0(ep0_handler);
+            break;
+        default:

In this case the `default` catches any `usbus_event_usb_t` that are not handled by the endpoint code. I'm still thinking if an assert should be triggered in that case, but it doesn't have to indicate a failure, only that the endpoint 0 code doesn't care about the event



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


More information about the notifications mailing list