diff options
author | tmk <nobody@nowhere> | 2011-02-22 01:21:53 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2011-02-22 03:09:23 +0900 |
commit | d2b9489a5e19fabb5d6ec285192b19dc25b36d5e (patch) | |
tree | ee312006103ccf8f6e18a54e9bca920700d0100d /pjrc | |
parent | 60052acc0fe3e6429f5c1d24073b1f6af019bd19 (diff) | |
download | qmk_firmware-d2b9489a5e19fabb5d6ec285192b19dc25b36d5e.tar.gz |
fixed hhkb to comply new API.
Diffstat (limited to 'pjrc')
-rw-r--r-- | pjrc/host.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/pjrc/host.c b/pjrc/host.c index 7247288bd..8da88517b 100644 --- a/pjrc/host.c +++ b/pjrc/host.c @@ -4,6 +4,7 @@ #include "usb_mouse.h" #include "debug.h" #include "host.h" +#include "util.h" #ifdef USB_NKRO_ENABLE @@ -80,14 +81,17 @@ uint8_t host_has_anykey(void) return cnt; } -uint8_t *host_get_keys(void) +uint8_t host_get_first_key(void) { - return keyboard_report->keys; -} - -uint8_t host_get_mods(void) -{ - return keyboard_report->mods; +#ifdef USB_NKRO_ENABLE + if (keyboard_nkro) { + uint8_t i = 0; + for (; i < REPORT_KEYS && !keyboard_report->keys[i]; i++) + ; + return i<<3 | biton(keyboard_report->keys[i]); + } +#endif + return keyboard_report->keys[0]; } |