saimaa: log UART TX to stderr
This commit is contained in:
@@ -177,6 +177,14 @@ static void saimaa_uart_write(void *opaque, hwaddr off, uint64_t val,
|
|||||||
SaimaaUartState *s = SAIMAA_UART(opaque);
|
SaimaaUartState *s = SAIMAA_UART(opaque);
|
||||||
(void)s;
|
(void)s;
|
||||||
if (off == 0x70) { /* UARTDM_TF */
|
if (off == 0x70) { /* UARTDM_TF */
|
||||||
|
static int uart_n;
|
||||||
|
if (uart_n < 64) {
|
||||||
|
fprintf(stderr, "saimaa-uart: TX 0x%02x '%c'\n",
|
||||||
|
(unsigned)(val & 0xff),
|
||||||
|
(val & 0xff) >= 32 && (val & 0xff) < 127 ?
|
||||||
|
(char)(val & 0xff) : '.');
|
||||||
|
uart_n++;
|
||||||
|
}
|
||||||
putchar(val & 0xff);
|
putchar(val & 0xff);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user