[riot-notifications] [RIOT-OS/RIOT] usbus: Add CDC-ACM (Serial console) function (#11085)

benpicco notifications at github.com
Mon Sep 30 15:29:05 CEST 2019


benpicco commented on this pull request.



> +            return -1;
+    }
+    return 1;
+}
+
+static void _handle_in(usbus_cdcacm_device_t *cdcacm,
+                       usbdev_ep_t *ep)
+{
+    if ((cdcacm->usbus->state != USBUS_STATE_CONFIGURED) ||
+        (cdcacm->state != USBUS_CDCACM_LINE_STATE_DTE)) {
+        return;
+    }
+    while (!tsrb_empty(&cdcacm->tsrb)) {
+        int c = tsrb_get_one(&cdcacm->tsrb);
+        ep->buf[cdcacm->occupied++] = (uint8_t)c;
+        if (cdcacm->occupied >= 64) {

this should better be a `#define` or a `sizeof`

-- 
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/11085#pullrequestreview-294973124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190930/5f63e5d7/attachment.htm>


More information about the notifications mailing list