diff options
author | tmk <nobody@nowhere> | 2011-05-21 10:28:57 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2011-05-21 10:28:57 +0900 |
commit | 74f7e19863ced21bf5d27c1fb1207f79f2195e24 (patch) | |
tree | c834e941748d6f4629b546bfce21fb9523d5e784 /pjrc | |
parent | 068c31a7ba9fc6aea33f69c0edb30ad195c320ec (diff) | |
download | firmware-74f7e19863ced21bf5d27c1fb1207f79f2195e24.tar.gz firmware-74f7e19863ced21bf5d27c1fb1207f79f2195e24.tar.bz2 firmware-74f7e19863ced21bf5d27c1fb1207f79f2195e24.zip |
added USB_EXTRA feature to HHKB/V-USB
Diffstat (limited to 'pjrc')
-rw-r--r-- | pjrc/host.c | 19 | ||||
-rwxr-xr-x | pjrc/usb.c | 4 |
2 files changed, 23 insertions, 0 deletions
diff --git a/pjrc/host.c b/pjrc/host.c index b69c6cb20..2a81e4c5e 100644 --- a/pjrc/host.c +++ b/pjrc/host.c @@ -2,7 +2,12 @@ #include <avr/interrupt.h> #include "usb_keycodes.h" #include "usb_keyboard.h" +#if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE) #include "usb_mouse.h" +#endif +#ifdef USB_EXTRA_ENABLE +#include "usb_extra.h" +#endif #include "debug.h" #include "host.h" #include "util.h" @@ -104,10 +109,24 @@ void host_send_keyboard_report(void) usb_keyboard_send_report(keyboard_report); } +#if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE) void host_mouse_send(report_mouse_t *report) { usb_mouse_send(report->x, report->y, report->v, report->h, report->buttons); } +#endif + +#ifdef USB_EXTRA_ENABLE +void host_system_send(uint8_t data) +{ + usb_extra_system_send(data); +} + +void host_audio_send(uint8_t data) +{ + usb_extra_audio_send(data); +} +#endif static inline void add_key_byte(uint8_t code) diff --git a/pjrc/usb.c b/pjrc/usb.c index b2c18d98d..711c0e68a 100755 --- a/pjrc/usb.c +++ b/pjrc/usb.c @@ -682,7 +682,11 @@ ISR(USB_GEN_vect) } } /* TODO: should keep IDLE rate on each keyboard interface */ +#ifdef USB_NKRO_ENABLE if (!keyboard_nkro && usb_keyboard_idle_config && (++div4 & 3) == 0) { +#else + if (usb_keyboard_idle_config && (++div4 & 3) == 0) { +#endif UENUM = KBD_ENDPOINT; if (UEINTX & (1<<RWAL)) { usb_keyboard_idle_count++; |