]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ibmpc: Fix XT reset comment and add inhibit_xt()
authortmk <hasu@tmk-kbd.com>
Mon, 26 Oct 2020 17:33:33 +0000 (02:33 +0900)
committertmk <hasu@tmk-kbd.com>
Mon, 26 Oct 2020 17:33:33 +0000 (02:33 +0900)
converter/ibmpc_usb/ibmpc_usb.c
tmk_core/protocol/ibmpc.h

index cf1ab0b747bf5ffb1e519722a2c10ffba6988043..43dcf0d890a4330f1337b316d90aebcaf85472b6 100644 (file)
@@ -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();
index 4f682aa7214fddbb08e72a82790946b031f2c4b2..64bc2c8ad428040842d98a9a96e249a24b2c8bf0 100644 (file)
@@ -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