From f09111a2a97aa3457d2a6cf9c362c53133348d3e Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Thu, 5 Jan 2023 15:32:07 +0100 Subject: [PATCH] samples: cdc_acm: do not block for one second after DTR set There is no need to block the thread for a second. Let it sleep for 100 milliseconds, which should be enough to set the host baud rate. Signed-off-by: Johann Fischer --- samples/subsys/usb/cdc_acm/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/subsys/usb/cdc_acm/src/main.c b/samples/subsys/usb/cdc_acm/src/main.c index f8f44ddf1cf..a1eaad517bd 100644 --- a/samples/subsys/usb/cdc_acm/src/main.c +++ b/samples/subsys/usb/cdc_acm/src/main.c @@ -200,8 +200,8 @@ void main(void) LOG_WRN("Failed to set DSR, ret code %d", ret); } - /* Wait 1 sec for the host to do all settings */ - k_busy_wait(1000000); + /* Wait 100ms for the host to do all settings */ + k_msleep(100); ret = uart_line_ctrl_get(dev, UART_LINE_CTRL_BAUD_RATE, &baudrate); if (ret) {