Skip to content

Commit 399363a

Browse files
jfischer-notmon-nordic
authored andcommitted
[nrf fromtree] 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 <[email protected]> (cherry picked from commit 5914131) Signed-off-by: Tomasz Moń <[email protected]>
1 parent 1354027 commit 399363a

File tree

3 files changed

+0
-52
lines changed

3 files changed

+0
-52
lines changed

samples/subsys/usb/console/Kconfig

-9
This file was deleted.

samples/subsys/usb/console/src/main.c

-30
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,22 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <sample_usbd.h>
8-
97
#include <zephyr/kernel.h>
108
#include <zephyr/sys/printk.h>
119
#include <zephyr/usb/usb_device.h>
12-
#include <zephyr/usb/usbd.h>
1310
#include <zephyr/drivers/uart.h>
1411

1512
BUILD_ASSERT(DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart),
1613
"Console device is not ACM CDC UART device");
1714

18-
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
19-
static struct usbd_context *sample_usbd;
20-
21-
static int enable_usb_device_next(void)
22-
{
23-
int err;
24-
25-
sample_usbd = sample_usbd_init_device(NULL);
26-
if (sample_usbd == NULL) {
27-
return -ENODEV;
28-
}
29-
30-
err = usbd_enable(sample_usbd);
31-
if (err) {
32-
return err;
33-
}
34-
35-
return 0;
36-
}
37-
#endif /* defined(CONFIG_USB_DEVICE_STACK_NEXT) */
38-
3915
int main(void)
4016
{
4117
const struct device *const dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
4218
uint32_t dtr = 0;
4319

44-
#if defined(CONFIG_USB_DEVICE_STACK_NEXT)
45-
if (enable_usb_device_next()) {
46-
return 0;
47-
}
48-
#else
4920
if (usb_enable(NULL)) {
5021
return 0;
5122
}
52-
#endif
5323

5424
/* Poll if the DTR flag was set */
5525
while (!dtr) {

samples/subsys/usb/console/usbd_next_prj.conf

-13
This file was deleted.

0 commit comments

Comments
 (0)