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

Kaspar Schleiser notifications at github.com
Mon Feb 11 12:37:24 CET 2019


kaspar030 commented on this pull request.



> +    mutex_lock(&usbus->lock);
+    for (usbus_interface_t *iface = usbus->iface; iface; iface = iface->next) {
+        if (destination == iface->idx) {
+            iface->handler->driver->event_handler(usbus, iface->handler, USBUS_MSG_TYPE_SETUP_RQ, pkt);
+        }
+    }
+    mutex_unlock(&usbus->lock);
+}
+
+
+static inline size_t usbus_pkt_maxlen(usbus_t *usbus, usb_setup_t *pkt)
+{
+    return pkt->length > usbus->in->len ? usbus->in->len : pkt->length;
+}
+
+void recv_setup(usbus_t *usbus, usbdev_ep_t *ep)

> do we have a function naming convention?

Yes, public (non-static) functions should be called ```module_function()``` (e.g., ```usbus_recv_setup()```). static functions should start with underline (```static void _recv_setup(void)```).

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


More information about the notifications mailing list