pc98_usb: Receive extra byte for 0xFB response
PC-9801-119(CMP-6D1Y7) https://geekhack.org/index.php?topic=110094.msg3164441#msg3164441
This commit is contained in:
parent
db4268bfa1
commit
c168e21bd7
1 changed files with 6 additions and 2 deletions
|
|
@ -60,8 +60,11 @@ static void pc98_send(uint8_t data)
|
||||||
|
|
||||||
static int16_t pc98_wait_response(void)
|
static int16_t pc98_wait_response(void)
|
||||||
{
|
{
|
||||||
int16_t code = -1;
|
int16_t code;
|
||||||
uint8_t timeout = 255;
|
uint8_t timeout;
|
||||||
|
RETRY:
|
||||||
|
code = -1;
|
||||||
|
timeout = 255;
|
||||||
while (timeout-- && (code = serial_recv2()) == -1) _delay_ms(1);
|
while (timeout-- && (code = serial_recv2()) == -1) _delay_ms(1);
|
||||||
|
|
||||||
// Keyboards require RDY pulse >=37us to send next data
|
// Keyboards require RDY pulse >=37us to send next data
|
||||||
|
|
@ -71,6 +74,7 @@ static int16_t pc98_wait_response(void)
|
||||||
PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
|
PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
|
||||||
|
|
||||||
xprintf("r%04X ", code);
|
xprintf("r%04X ", code);
|
||||||
|
if (code == 0xFB) goto RETRY;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue