From 768961ec59c9373367d06ca400d3ed94274d587d Mon Sep 17 00:00:00 2001 From: Michal Sieron Date: Thu, 29 Jul 2021 12:18:41 +0200 Subject: [PATCH] Use getchar/putchar instead of readchar/base_putchar --- litex/soc/software/bios/readline.c | 8 ++++---- litex/soc/software/bios/readline_simple.c | 2 +- litex/soc/software/demo/donut.c | 2 +- litex/soc/software/demo/main.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/litex/soc/software/bios/readline.c b/litex/soc/software/bios/readline.c index edd1259a5..dd27d7bfe 100644 --- a/litex/soc/software/bios/readline.c +++ b/litex/soc/software/bios/readline.c @@ -54,15 +54,15 @@ static int read_key(void) { char c; char esc[5]; - c = readchar(); + c = getchar(); if (c == 27) { int i = 0; - esc[i++] = readchar(); - esc[i++] = readchar(); + esc[i++] = getchar(); + esc[i++] = getchar(); if (isdigit(esc[1])) { while(1) { - esc[i] = readchar(); + esc[i] = getchar(); if (esc[i++] == '~') break; if (i == ARRAY_SIZE(esc)) diff --git a/litex/soc/software/bios/readline_simple.c b/litex/soc/software/bios/readline_simple.c index 2d4707238..b602a6fba 100644 --- a/litex/soc/software/bios/readline_simple.c +++ b/litex/soc/software/bios/readline_simple.c @@ -22,7 +22,7 @@ int readline(char *s, int size) c[1] = 0; ptr = 0; while(1) { - c[0] = readchar(); + c[0] = getchar(); if (c[0] == skip) continue; skip = 0; diff --git a/litex/soc/software/demo/donut.c b/litex/soc/software/demo/donut.c index a96d9a9ac..8a15dd1ba 100644 --- a/litex/soc/software/demo/donut.c +++ b/litex/soc/software/demo/donut.c @@ -59,7 +59,7 @@ void donut(void) { R(5, 7, cA, sA); R(5, 8, cB, sB); if (readchar_nonblock()) { - readchar(); + getchar(); break; } fputs("\x1b[23A", stdout); diff --git a/litex/soc/software/demo/main.c b/litex/soc/software/demo/main.c index 3cf125314..e97b0c0c3 100644 --- a/litex/soc/software/demo/main.c +++ b/litex/soc/software/demo/main.c @@ -21,7 +21,7 @@ static char *readstr(void) static int ptr = 0; if(readchar_nonblock()) { - c[0] = readchar(); + c[0] = getchar(); c[1] = 0; switch(c[0]) { case 0x7f: