[platform] fix the dgetc signature problem

This commit is contained in:
Travis Geiselbrecht
2009-06-28 12:18:39 -07:00
parent bb4fd9e57e
commit 37cf0c1982
4 changed files with 15 additions and 9 deletions

View File

@@ -32,15 +32,21 @@ void _dputc(char c)
*REG8(DEBUG_STDOUT) = c;
}
int dgetc(char *c)
int dgetc(char *c, bool wait)
{
int8_t result = (int8_t)*REG8(DEBUG_STDIN);
for (;;) {
int8_t result = (int8_t)*REG8(DEBUG_STDIN);
if (result == -1)
return -1;
if (result == -1) {
if (wait)
continue;
else
return -1;
}
*c = (char)result;
return 0;
*c = (char)result;
return 0;
}
}
void debug_dump_regs(void)

View File

@@ -98,7 +98,7 @@ void _dputc(char c)
uart_putc(0, c);
}
int dgetc(char *c)
int dgetc(char *c, bool wait)
{
int result = uart_getc(0, false);

View File

@@ -51,7 +51,7 @@ void _dputc(char c)
#endif
}
int dgetc(char *c)
int dgetc(char *c, bool wait)
{
int n;
#if WITH_DEBUG_DCC

View File

@@ -37,7 +37,7 @@ void _dputc(char c)
uart_putc(DEBUG_UART, c);
}
int dgetc(char *c)
int dgetc(char *c, bool wait)
{
int _c;