zephyr/samples/subsys/console/echo/src/main.c
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00

28 lines
584 B
C

/*
* Copyright (c) 2017 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <console/console.h>
static const char prompt[] = "Start typing characters to see them echoed back\r\n";
void main(void)
{
console_init();
printk("You should see another line with instructions below. If not,\n");
printk("the (interrupt-driven) console device doesn't work as expected:\n");
console_write(NULL, prompt, sizeof(prompt) - 1);
while (1) {
uint8_t c = console_getchar();
console_putchar(c);
if (c == '\r') {
console_putchar('\n');
}
}
}