From 4028b200be6c8bfd1026af59d1db85a2706b8f74 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 12 May 2020 18:21:40 +0900 Subject: [PATCH] ibmpc: Fix Timeout error Timeout error may be recoverable but may not in some situations. For safety it is handled as a real error to start keyboard recognition again. --- tmk_core/protocol/ibmpc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tmk_core/protocol/ibmpc.c b/tmk_core/protocol/ibmpc.c index 546c2ac6..cb612eb1 100644 --- a/tmk_core/protocol/ibmpc.c +++ b/tmk_core/protocol/ibmpc.c @@ -247,11 +247,14 @@ ISR(IBMPC_INT_VECT) } else { // should not take more than 1ms if (timer_start != t && (uint8_t)(timer_start + 1) != t) { + ibmpc_isr_debug = isr_state; ibmpc_error = IBMPC_ERR_TIMEOUT; - //goto ERROR; - // timeout error recovery by clearing isr_state? - timer_start = t; - isr_state = 0x8000; + goto ERROR; + + // timeout error recovery - start receiving new data + // it seems to work somehow but may not under unstable situation + //timer_start = t; + //isr_state = 0x8000; } } -- 2.46.2