Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adb_usb: Lag on typing #518

Closed
tmk opened this issue Jan 19, 2018 · 0 comments
Closed

adb_usb: Lag on typing #518

tmk opened this issue Jan 19, 2018 · 0 comments

Comments

@tmk
Copy link
Owner

tmk commented Jan 19, 2018

It feels longer lag on key press.

Cause

Adding ADB mouse support causes or makes worse this problem. In addition to 12 ms polling interval
of keyboard mouse support uses another _delay_ms(12) for its polling. In the result 24ms delay is required on every keyboard polling.

_delay_ms(12); // delay for preventing overload of poor ADB keyboard controller

Solution

Instead of busy loop with _delay_ms(12) it should use timer and check elapsed time.

Background

In ADB protocol host controller polls devices on bus one by one repeatedly with talk command.
https://developer.apple.com/legacy/library/technotes/hw/hw_01.html#Section2

Some old keyboards like IIgs goes bad at fast polling rate, such as missing key. You have to long interval with those keyboards, we chose 12ms.

* Don't call this in a row without the delay, otherwise it makes some of poor controllers
* overloaded and misses strokes. Recommended interval is 12ms.
*
* Thanks a lot, blargg!
* <http://geekhack.org/index.php?topic=14290.msg1068919#msg1068919>
* <http://geekhack.org/index.php?topic=14290.msg1070139#msg1070139>

@tmk tmk closed this as completed in d00d7e8 Jan 19, 2018
talmuth pushed a commit to talmuth/tmk_keyboard that referenced this issue Aug 8, 2018
* cub/master: (444 commits)
  Inline functions need to be declared as static
  Add include guards
  Add a full example of a tenkeyless using the teensy 3.2 (tmk#543)
  Improve ASCII representation of 122 (tmk#544)
  hhkb: Fix for USB NKRO for RN42
  usb_usb: Fix code format
  usb_usb: Support Brazilian specific key in unimap
  usb_usb: Support Korean specific keys in unimap
  core: lufa: Add delay for console startup
  hhkb: Update README and remove makefiles
  core: Add utility macros in action_macro.h (tmk#532)
  core: Add utility type_code() in aciton.h tmk#528
  core: Typo (mantrix -> matrix)
  core: Saved 60~ bytes (and possible performance) by storing col_mask when iterating through columns (tmk#522)
  Typos (tmk#524)
  core: Fix for un-defined function when compiling without MOUSEKEY_ENABLE
  core: Fix for unused function when compiling without MOUSEKEY_ENABLE
  adb_usb: Update firmware binary
  adb_usb: Fix tmk#518 Lag on typing
  core: Fix for warning of unused function standby()
  ...
talmuth pushed a commit to talmuth/tmk_keyboard that referenced this issue Aug 9, 2018
* cub/master: (189 commits)
  Inline functions need to be declared as static
  Add include guards
  Add a full example of a tenkeyless using the teensy 3.2 (tmk#543)
  Improve ASCII representation of 122 (tmk#544)
  hhkb: Fix for USB NKRO for RN42
  usb_usb: Fix code format
  usb_usb: Support Brazilian specific key in unimap
  usb_usb: Support Korean specific keys in unimap
  core: lufa: Add delay for console startup
  hhkb: Update README and remove makefiles
  core: Add utility macros in action_macro.h (tmk#532)
  core: Add utility type_code() in aciton.h tmk#528
  core: Typo (mantrix -> matrix)
  core: Saved 60~ bytes (and possible performance) by storing col_mask when iterating through columns (tmk#522)
  Typos (tmk#524)
  core: Fix for un-defined function when compiling without MOUSEKEY_ENABLE
  core: Fix for unused function when compiling without MOUSEKEY_ENABLE
  adb_usb: Update firmware binary
  adb_usb: Fix tmk#518 Lag on typing
  core: Fix for warning of unused function standby()
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant