mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Use getchar/putchar instead of readchar/base_putchar
This commit is contained in:
parent
ead3f8b2e0
commit
768961ec59
4 changed files with 7 additions and 7 deletions
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue