samples: console: echo: Test output-only mode too

We have cases with UART drivers where TX interrupt handling is not
bootstrapped properly on enabling them. To make such cases more
obvious, start this sample with console_write(), the output of which
wouldn't appear if that's the case. (Of course, the sample starts
with printk() exlaining what may happpen.)

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
Paul Sokolovsky 2018-11-13 15:20:02 +03:00 committed by Kumar Gala
commit 325954de8f

View file

@ -6,11 +6,15 @@
#include <zephyr.h>
#include <console.h>
static const char prompt[] = "Start typing characters to see them echoed back\n";
void main(void)
{
console_init();
printk("Start typing characters to see them echoed back\n");
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) {
u8_t c = console_getchar();