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

Alexandre Abadie notifications at github.com
Mon Jun 17 09:29:19 CEST 2019


aabadie commented on this pull request.

Maybe add a README to the test application like for CDC ECM?
Also I'm wondering how USB stdio is selected over UART (which is the default on samr21-xpro for example). Is this done magically by the build system ?

> + * @author  Dylan Laduranty <dylan.laduranty at mesotic.com>
+ * @author  Koen Zandberg <koen at bergzand.net>
+ * @}
+ */
+
+#include "tsrb.h"
+
+#include "usb/descriptor.h"
+#include "usb/cdc.h"
+#include "usb/cdc/acm.h"
+#include "usb/descriptor.h"
+#include "usb/usbus.h"
+#include "usb/usbus/cdc/acm.h"
+#include "usb/usbus/control.h"
+
+#include <string.h>

This should be the first include

> +ssize_t stdio_read(void* buffer, size_t len)
+{
+    (void)buffer;
+    (void)len;
+    return isrpipe_read(&cdc_stdio_isrpipe, buffer, len);
+}
+
+ssize_t stdio_write(const void* buffer, size_t len)
+{
+    usbus_cdc_acm_submit(&cdcacm, buffer, len);
+    /* Use tsrb and flush */
+    return len;
+}
+
+void cdcacm_rx_pipe(usbus_t *usbus, usbus_cdcacm_device_t *cdcacm,
+                           uint8_t *data, size_t len)

minor alignment issue

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


More information about the notifications mailing list