zephyr/samples/subsys/usb/console/src/main.c
Andrei Emeltchenko bf0a4a8cfb samples: usb: Update samples for new port name
Use new multi instance interface and new port names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00

28 lines
572 B
C

/*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <misc/printk.h>
#include <misc/util.h>
#include <string.h>
void main(void)
{
if (strlen(CONFIG_UART_CONSOLE_ON_DEV_NAME) !=
strlen(CONFIG_CDC_ACM_PORT_NAME_0) ||
strncmp(CONFIG_UART_CONSOLE_ON_DEV_NAME, CONFIG_CDC_ACM_PORT_NAME_0,
strlen(CONFIG_UART_CONSOLE_ON_DEV_NAME))) {
printk("Error: Console device name is not USB ACM\n");
return;
}
while (1) {
printk("Hello World! %s\n", CONFIG_ARCH);
k_sleep(K_SECONDS(1));
}
}