]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
ibmpc: Fix how to initialize keyboard
authortmk <hasu@tmk-kbd.com>
Wed, 8 Jan 2020 06:00:44 +0000 (15:00 +0900)
committertmk <hasu@tmk-kbd.com>
Sat, 29 Feb 2020 08:29:54 +0000 (17:29 +0900)
converter/ibmpc_usb/ibmpc_usb.c

index b861c4fba52430624d6f78db32d74d80679f4002..0527cfcf510c59e4b990951344e53db6de5736b2 100644 (file)
@@ -78,10 +78,6 @@ static uint16_t read_keyboard_id(void)
 void matrix_init(void)
 {
     debug_enable = true;
-    ibmpc_host_init();
-
-    // hard reset for XT keyboard
-    IBMPC_RESET();
 
     // initialize matrix state: all keys off
     for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
@@ -138,6 +134,9 @@ uint8_t matrix_scan(void)
             keyboard_id = 0x0000;
             last_time = timer_read();
             state = WAIT_STARTUP;
+
+            ibmpc_host_init();
+            IBMPC_RESET();  // hard reset for some old XT keyboards
             matrix_clear();
             clear_keyboard();
             break;