Skip to content

Commit

Permalink
fix: Actually add the zmk-usb-logging snippet.
Browse files Browse the repository at this point in the history
* D'oh.
  • Loading branch information
petejohanson committed Jun 24, 2024
1 parent 7be955f commit 261e1df
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
36 changes: 36 additions & 0 deletions app/snippets/zmk-usb-logging/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _snippet-cdc-acm-console:

CDC-ACM Console Snippet (cdc-acm-console)
#########################################

.. code-block:: console
west build -S cdc-acm-console [...]
Overview
********

This snippet redirects serial console output to a CDC ACM UART. The USB device
which should be used is configured using :ref:`devicetree`.

Requirements
************

Hardware support for:

- :kconfig:option:`CONFIG_USB_DEVICE_STACK`
- :kconfig:option:`CONFIG_SERIAL`
- :kconfig:option:`CONFIG_CONSOLE`
- :kconfig:option:`CONFIG_UART_CONSOLE`
- :kconfig:option:`CONFIG_UART_LINE_CTRL`

A devicetree node with node label ``zephyr_udc0`` that points to an enabled USB
device node with driver support. This should look roughly like this in
:ref:`your devicetree <get-devicetree-outputs>`:

.. code-block:: DTS
zephyr_udc0: usbd@deadbeef {
compatible = "vnd,usb-device";
/* ... */
};
4 changes: 4 additions & 0 deletions app/snippets/zmk-usb-logging/snippet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: zmk-usb-logging
append:
EXTRA_CONF_FILE: zmk-usb-logging.conf
EXTRA_DTC_OVERLAY_FILE: zmk-usb-logging.overlay
2 changes: 2 additions & 0 deletions app/snippets/zmk-usb-logging/zmk-usb-logging.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_ZMK_USB_LOGGING=y

18 changes: 18 additions & 0 deletions app/snippets/zmk-usb-logging/zmk-usb-logging.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2024 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

/ {
chosen {
zephyr,console = &snippet_zmk_usb_logging_uart;
zephyr,shell-uart = &snippet_zmk_usb_logging_uart;
};
};

&zephyr_udc0 {
snippet_zmk_usb_logging_uart: snippet_zmk_usb_logging_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

0 comments on commit 261e1df

Please sign in to comment.