samples: usb: clean up legacy USB CDC ACM console sample

Remove the configuration for the new USB device stack, as there is now a
separate sample that demonstrates how to use it with Kconfig option
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2025-02-06 12:23:28 +01:00 committed by Benjamin Cabé
commit 5914131852
3 changed files with 0 additions and 52 deletions

View file

@ -1,9 +0,0 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
# Source common USB sample options used to initialize new experimental USB
# device stack. The scope of these options is limited to USB samples in project
# tree, you cannot use them in your own application.
source "samples/subsys/usb/common/Kconfig.sample_usbd"
source "Kconfig.zephyr"

View file

@ -4,52 +4,22 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <sample_usbd.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/drivers/uart.h>
BUILD_ASSERT(DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart),
"Console device is not ACM CDC UART device");
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
static struct usbd_context *sample_usbd;
static int enable_usb_device_next(void)
{
int err;
sample_usbd = sample_usbd_init_device(NULL);
if (sample_usbd == NULL) {
return -ENODEV;
}
err = usbd_enable(sample_usbd);
if (err) {
return err;
}
return 0;
}
#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */
int main(void)
{
const struct device *const dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
uint32_t dtr = 0;
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
if (enable_usb_device_next()) {
return 0;
}
#else
if (usb_enable(NULL)) {
return 0;
}
#endif
/* Poll if the DTR flag was set */
while (!dtr) {

View file

@ -1,13 +0,0 @@
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_LINE_CTRL=y
CONFIG_USBD_CDC_ACM_CLASS=y
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_SAMPLE_USBD_PID=0x0004
CONFIG_SAMPLE_USBD_PRODUCT="USBD console sample"