1 /*
2  * Copyright (c) 2016 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <zephyr/sys/printk.h>
9 #include <zephyr/drivers/uart.h>
10 
11 BUILD_ASSERT(DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart),
12 	     "Console device is not ACM CDC UART device");
13 
main(void)14 int main(void)
15 {
16 	const struct device *const dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
17 	uint32_t dtr = 0;
18 
19 	/* Poll if the DTR flag was set */
20 	while (!dtr) {
21 		uart_line_ctrl_get(dev, UART_LINE_CTRL_DTR, &dtr);
22 		/* Give CPU resources to low priority threads. */
23 		k_sleep(K_MSEC(100));
24 	}
25 
26 	while (1) {
27 		printk("Hello World! %s\n", CONFIG_ARCH);
28 		k_sleep(K_SECONDS(1));
29 	}
30 }
31