Skip to content

Commit

Permalink
drivers: console: fix USB initialization
Browse files Browse the repository at this point in the history
Initialize USB even if USB_UART_DTR_WAIT is not enabled.

Fixes: #25811

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
  • Loading branch information
jfischer-no authored and carlescufi committed Jun 2, 2020
1 parent edd7284 commit 6da7e41
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/console/uart_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,15 @@ static int uart_console_init(struct device *arg)

__ASSERT_NO_MSG(uart_console_dev);

#if defined(CONFIG_USB_UART_CONSOLE) && defined(CONFIG_USB_UART_DTR_WAIT)
#if defined(CONFIG_USB_UART_CONSOLE)
int ret;

ret = usb_enable(NULL);
if (ret != 0) {
return ret;
}

#if defined(CONFIG_USB_UART_DTR_WAIT)
while (1) {
u32_t dtr = 0U;

Expand All @@ -618,6 +619,7 @@ static int uart_console_init(struct device *arg)
}
}
k_busy_wait(1000000);
#endif
#endif

uart_console_hook_install();
Expand Down

0 comments on commit 6da7e41

Please sign in to comment.