/** * * @brief Initialize one UART as the console/debug port * * @return 0 if successful, otherwise failed. */ static int uart_console_init(struct device *arg) { ARG_UNUSED(arg); uart_console_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME); uart_console_hook_install(); return 0; }
/** * * @brief Initialize one UART as the console/debug port * * @return 0 if successful, otherwise failed. */ static int uart_console_init(struct device *arg) { ARG_UNUSED(arg); uart_console_dev = device_get_binding(CONFIG_UART_CONSOLE_ON_DEV_NAME); #if defined(CONFIG_USB_UART_CONSOLE) && defined(CONFIG_USB_UART_DTR_WAIT) while (1) { u32_t dtr = 0; uart_line_ctrl_get(uart_console_dev, LINE_CTRL_DTR, &dtr); if (dtr) { break; } } k_busy_wait(1000000); #endif uart_console_hook_install(); return 0; }