From d73bedb51acd6c9b145e8b66c9e3207549599bf1 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 16 Jan 2021 23:31:22 +0900 Subject: [PATCH] pc98_usb: Add RDY pulse in response receive #666 RDY high pulse(>=37us) is required to allow keyboard to send next data. https://archive.org/stream/PC9800TechnicalDataBookHARDWARE1993/PC-9800TechnicalDataBook_HARDWARE1993#page/n157 --- converter/pc98_usb/matrix.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c index ce5a5b37..17335aa9 100644 --- a/converter/pc98_usb/matrix.c +++ b/converter/pc98_usb/matrix.c @@ -63,6 +63,13 @@ static int16_t pc98_wait_response(void) int16_t code = -1; uint8_t timeout = 255; while (timeout-- && (code = serial_recv2()) == -1) _delay_ms(1); + + // Keyboards require RDY pulse >=37us to send next data + // https://archive.org/stream/PC9800TechnicalDataBookHARDWARE1993/PC-9800TechnicalDataBook_HARDWARE1993#page/n157 + PC98_RDY_PORT |= (1<=37us to send next data + // https://archive.org/stream/PC9800TechnicalDataBookHARDWARE1993/PC-9800TechnicalDataBook_HARDWARE1993#page/n157 + PC98_RDY_PORT |= (1<