zephyr/samples/subsys/console/getchar/src/main.c
Niranjhana N ed72015dbe samples: console: add print statements for user
Add print statements to let user know what kind
of input the test is waiting for.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-07-13 08:48:40 -04:00

23 lines
346 B
C

/*
* Copyright (c) 2017 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <misc/printk.h>
#include <console.h>
void main(void)
{
console_init();
printk("Start typing characters to see their hex codes printed\n");
while (1) {
u8_t c = console_getchar();
printk("char: [0x%x] %c\n", c, c);
}
}