Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix ADB missing keystrokes problem Thanks, blargg! #14
- Add delay between scans to prevent overlaod of ADB keyboard controllers
- <http://geekhack.org/index.php?topic=14290.msg1068919#msg1068919>
  • Loading branch information
yashikno committed Oct 8, 2013
1 parent 63b3e2c commit e8e8f93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions converter/adb_usb/matrix.c
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions protocol/adb.c
Expand Up @@ -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;
Expand Down

0 comments on commit e8e8f93

Please sign in to comment.