diff --git a/app/snippets/zmk-usb-logging/snippet.yml b/app/snippets/zmk-usb-logging/snippet.yml new file mode 100644 index 00000000000..8f218085008 --- /dev/null +++ b/app/snippets/zmk-usb-logging/snippet.yml @@ -0,0 +1,4 @@ +name: zmk-usb-logging +append: + EXTRA_CONF_FILE: zmk-usb-logging.conf + EXTRA_DTC_OVERLAY_FILE: zmk-usb-logging.overlay diff --git a/app/snippets/zmk-usb-logging/zmk-usb-logging.conf b/app/snippets/zmk-usb-logging/zmk-usb-logging.conf new file mode 100644 index 00000000000..57893df5f9d --- /dev/null +++ b/app/snippets/zmk-usb-logging/zmk-usb-logging.conf @@ -0,0 +1,2 @@ +CONFIG_ZMK_USB_LOGGING=y + diff --git a/app/snippets/zmk-usb-logging/zmk-usb-logging.overlay b/app/snippets/zmk-usb-logging/zmk-usb-logging.overlay new file mode 100644 index 00000000000..5ceda583f49 --- /dev/null +++ b/app/snippets/zmk-usb-logging/zmk-usb-logging.overlay @@ -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"; + }; +};