From 842b3f29b6d09adcc2d0b6c5a1a525b6c4f7e2f8 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 27 Oct 2020 02:33:33 +0900 Subject: [PATCH] ibmpc: Fix XT reset comment and add inhibit_xt() --- converter/ibmpc_usb/ibmpc_usb.c | 11 ++++++----- tmk_core/protocol/ibmpc.h | 8 +++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/converter/ibmpc_usb/ibmpc_usb.c b/converter/ibmpc_usb/ibmpc_usb.c index cf1ab0b7..43dcf0d8 100644 --- a/converter/ibmpc_usb/ibmpc_usb.c +++ b/converter/ibmpc_usb/ibmpc_usb.c @@ -204,9 +204,10 @@ uint8_t matrix_scan(void) case XT_RESET: // Reset XT-initialize keyboard // XT: hard reset 500ms for IBM XT Type-1 keyboard and clones - // XT: soft reset 20ms min(clock Lo) - ibmpc_host_disable(); // soft reset: inihibit(clock Lo/Data Hi) - IBMPC_RST_LO(); // hard reset: reset pin Lo + // XT: soft reset 20ms min + // https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol#keyboard-soft-reset + ibmpc_host_disable(); // soft reset: Clock Lo/Data Hi + IBMPC_RST_LO(); // hard reset: Reset pin Lo init_time = timer_read(); state = XT_RESET_WAIT; @@ -217,9 +218,9 @@ uint8_t matrix_scan(void) } break; case XT_RESET_DONE: - IBMPC_RST_HIZ(); // hard reset: reset pin HiZ + IBMPC_RST_HIZ(); // hard reset: Reset pin HiZ ibmpc_host_isr_clear(); - ibmpc_host_enable(); // soft reset: idle(clock Hi/Data Hi) + ibmpc_host_enable(); // soft reset: idle(Clock Hi/Data Hi) xprintf("X%u ", timer_read()); init_time = timer_read(); diff --git a/tmk_core/protocol/ibmpc.h b/tmk_core/protocol/ibmpc.h index 4f682aa7..64bc2c8a 100644 --- a/tmk_core/protocol/ibmpc.h +++ b/tmk_core/protocol/ibmpc.h @@ -188,11 +188,17 @@ static inline void idle(void) data_hi(); } -/* inhibit device to send */ +/* inhibit device to send(AT), soft reset(XT) */ static inline void inhibit(void) { clock_lo(); data_hi(); } +/* inhibit device to send(XT) */ +static inline void inhibit_xt(void) +{ + clock_hi(); + data_lo(); +} #endif -- 2.46.2