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:
parent
49bb163756
commit
325954de8f
1 changed files with 5 additions and 1 deletions
|
@ -6,11 +6,15 @@
|
||||||
#include <zephyr.h>
|
#include <zephyr.h>
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
|
|
||||||
|
static const char prompt[] = "Start typing characters to see them echoed back\n";
|
||||||
|
|
||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
console_init();
|
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) {
|
while (1) {
|
||||||
u8_t c = console_getchar();
|
u8_t c = console_getchar();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue