From: tmk Date: Tue, 8 Oct 2013 03:23:25 +0000 (+0900) Subject: Fix ADB missing keystrokes problem Thanks, blargg! #14 X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=e8e8f93bcf0cdc8d72d35662db5a1da4716762b8;p=max%2Ftmk_keyboard.git Fix ADB missing keystrokes problem Thanks, blargg! #14 - Add delay between scans to prevent overlaod of ADB keyboard controllers - --- diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c index ee17f655..566592c9 100644 --- a/converter/adb_usb/matrix.c +++ b/converter/adb_usb/matrix.c @@ -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; diff --git a/protocol/adb.c b/protocol/adb.c index e4e26b7d..155d223f 100644 --- a/protocol/adb.c +++ b/protocol/adb.c @@ -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! + */ uint16_t adb_host_kbd_recv(void) { uint16_t data = 0;