saimaa: log UART TX to stderr

This commit is contained in:
SashegDev
2026-09-11 07:52:15 +00:00
parent 47c0a82601
commit 738fa4cb76
+8
View File
@@ -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;