From c168e21bd79acabd5f37dd0b77de8340d6021862 Mon Sep 17 00:00:00 2001 From: tmk Date: Thu, 15 Jun 2023 12:43:16 +0900 Subject: [PATCH] pc98_usb: Receive extra byte for 0xFB response PC-9801-119(CMP-6D1Y7) https://geekhack.org/index.php?topic=110094.msg3164441#msg3164441 --- converter/pc98_usb/matrix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c index 0dbf4fc7..e98ee534 100644 --- a/converter/pc98_usb/matrix.c +++ b/converter/pc98_usb/matrix.c @@ -60,8 +60,11 @@ static void pc98_send(uint8_t data) static int16_t pc98_wait_response(void) { - int16_t code = -1; - uint8_t timeout = 255; + int16_t code; + uint8_t timeout; +RETRY: + code = -1; + timeout = 255; while (timeout-- && (code = serial_recv2()) == -1) _delay_ms(1); // Keyboards require RDY pulse >=37us to send next data @@ -71,6 +74,7 @@ static int16_t pc98_wait_response(void) PC98_RDY_PORT &= ~(1<