mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Replace putsnonl(s) with fputs(s, stdout)
It won't compile, because stdout is undefined, but including headers from picolibc should fix that
This commit is contained in:
parent
acf3a4570b
commit
19966edb61
6 changed files with 10 additions and 20 deletions
|
@ -20,7 +20,7 @@ void dump_bytes(unsigned int *ptr, int count, unsigned long addr)
|
|||
char *data = (char *)ptr;
|
||||
int line_bytes = 0, i = 0;
|
||||
|
||||
putsnonl("Memory dump:");
|
||||
fputs("Memory dump:", stdout);
|
||||
while (count > 0) {
|
||||
line_bytes =
|
||||
(count > NUMBER_OF_BYTES_ON_A_LINE)?
|
||||
|
|
|
@ -31,7 +31,7 @@ int readline(char *s, int size)
|
|||
case 0x08:
|
||||
if(ptr > 0) {
|
||||
ptr--;
|
||||
putsnonl("\x08 \x08");
|
||||
fputs("\x08 \x08", stdout);
|
||||
}
|
||||
break;
|
||||
case 0x07:
|
||||
|
@ -39,15 +39,15 @@ int readline(char *s, int size)
|
|||
case '\r':
|
||||
skip = '\n';
|
||||
s[ptr] = 0x00;
|
||||
putsnonl("\n");
|
||||
fputs("\n", stdout);
|
||||
return 0;
|
||||
case '\n':
|
||||
skip = '\r';
|
||||
s[ptr] = 0x00;
|
||||
putsnonl("\n");
|
||||
fputs("\n", stdout);
|
||||
return 0;
|
||||
default:
|
||||
putsnonl(c);
|
||||
fputs(c, stdout);
|
||||
s[ptr] = c[0];
|
||||
ptr++;
|
||||
break;
|
||||
|
|
|
@ -62,6 +62,6 @@ void donut(void) {
|
|||
readchar();
|
||||
break;
|
||||
}
|
||||
putsnonl("\x1b[23A");
|
||||
fputs("\x1b[23A", stdout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ static char *readstr(void)
|
|||
case 0x08:
|
||||
if(ptr > 0) {
|
||||
ptr--;
|
||||
putsnonl("\x08 \x08");
|
||||
fputs("\x08 \x08", stdout);
|
||||
}
|
||||
break;
|
||||
case 0x07:
|
||||
|
@ -36,13 +36,13 @@ static char *readstr(void)
|
|||
case '\r':
|
||||
case '\n':
|
||||
s[ptr] = 0x00;
|
||||
putsnonl("\n");
|
||||
fputs("\n", stdout);
|
||||
ptr = 0;
|
||||
return s;
|
||||
default:
|
||||
if(ptr >= (sizeof(s) - 1))
|
||||
break;
|
||||
putsnonl(c);
|
||||
fputs(c, stdout);
|
||||
s[ptr] = c[0];
|
||||
ptr++;
|
||||
break;
|
||||
|
|
|
@ -15,8 +15,6 @@ void console_set_read_hook(console_read_hook r, console_read_nonblock_hook rn);
|
|||
char readchar(void);
|
||||
int readchar_nonblock(void);
|
||||
|
||||
void putsnonl(const char *s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -71,11 +71,3 @@ int readchar_nonblock(void)
|
|||
|
||||
#endif
|
||||
|
||||
void putsnonl(const char *s)
|
||||
{
|
||||
while(*s) {
|
||||
putchar(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue