]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
Fix ADB missing keystrokes problem Thanks, blargg! #14
authortmk <nobody@nowhere>
Tue, 8 Oct 2013 03:23:25 +0000 (12:23 +0900)
committertmk <nobody@nowhere>
Tue, 8 Oct 2013 03:23:25 +0000 (12:23 +0900)
- Add delay between scans to prevent overlaod of ADB keyboard controllers
- <http://geekhack.org/index.php?topic=14290.msg1068919#msg1068919>

converter/adb_usb/matrix.c
protocol/adb.c

index ee17f655f2ddff1dc289f085fafe588404aa74d5..566592c93f7a83270835d51beeae83c420d09dda 100644 (file)
@@ -85,6 +85,7 @@ uint8_t matrix_scan(void)
     uint8_t key0, key1;
 
     is_modified = false;
+    _delay_ms(16);  // delay for preventing overload of poor ADB keyboard controller
     codes = adb_host_kbd_recv();
     key0 = codes>>8;
     key1 = codes&0xFF;
index e4e26b7d7b90fb5a5da5f4ae7b03023b29c867f9..155d223fe7ed1f0c438a2ef5226d7b4f88c5ea7e 100644 (file)
@@ -83,6 +83,12 @@ bool adb_host_psw(void)
 }
 #endif
 
+/*
+ * Don't call this in a row without the delay, otherwise it makes some of poor controllers
+ * overloaded and misses strokes. Recommended delay is 16ms.
+ *
+ * Thanks a lot, blargg! <http://geekhack.org/index.php?topic=14290.msg1068919#msg1068919>
+ */
 uint16_t adb_host_kbd_recv(void)
 {
     uint16_t data = 0;