aboutsummaryrefslogtreecommitdiff
path: root/keyboard.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2011-05-21 10:28:57 +0900
committertmk <nobody@nowhere>2011-05-21 10:28:57 +0900
commit74f7e19863ced21bf5d27c1fb1207f79f2195e24 (patch)
treec834e941748d6f4629b546bfce21fb9523d5e784 /keyboard.c
parent068c31a7ba9fc6aea33f69c0edb30ad195c320ec (diff)
downloadqmk_firmware-74f7e19863ced21bf5d27c1fb1207f79f2195e24.tar.gz
qmk_firmware-74f7e19863ced21bf5d27c1fb1207f79f2195e24.zip
added USB_EXTRA feature to HHKB/V-USB
Diffstat (limited to 'keyboard.c')
-rw-r--r--keyboard.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/keyboard.c b/keyboard.c
index 03db3257a..fd6e23042 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -11,9 +11,7 @@
11#ifdef MOUSEKEY_ENABLE 11#ifdef MOUSEKEY_ENABLE
12#include "mousekey.h" 12#include "mousekey.h"
13#endif 13#endif
14/* TODO: shoud make new API */
15#ifdef USB_EXTRA_ENABLE 14#ifdef USB_EXTRA_ENABLE
16#include "usb_extra.h"
17#include <util/delay.h> 15#include <util/delay.h>
18#endif 16#endif
19 17
@@ -68,23 +66,27 @@ void keyboard_proc(void)
68#ifdef USB_EXTRA_ENABLE 66#ifdef USB_EXTRA_ENABLE
69 // audio control & system control 67 // audio control & system control
70 else if (code == KB_MUTE) { 68 else if (code == KB_MUTE) {
71 usb_extra_audio_send(AUDIO_MUTE); 69 host_audio_send(AUDIO_MUTE);
72 usb_extra_audio_send(0);
73 _delay_ms(500); 70 _delay_ms(500);
71 host_audio_send(0);
74 } else if (code == KB_VOLU) { 72 } else if (code == KB_VOLU) {
75 usb_extra_audio_send(AUDIO_VOL_UP); 73 host_audio_send(AUDIO_VOL_UP);
76 usb_extra_audio_send(0);
77 _delay_ms(200); 74 _delay_ms(200);
75 host_audio_send(0);
78 } else if (code == KB_VOLD) { 76 } else if (code == KB_VOLD) {
79 usb_extra_audio_send(AUDIO_VOL_DOWN); 77 host_audio_send(AUDIO_VOL_DOWN);
80 usb_extra_audio_send(0);
81 _delay_ms(200); 78 _delay_ms(200);
79 host_audio_send(0);
82 } else if (code == KB_PWR) { 80 } else if (code == KB_PWR) {
81#ifdef HOST_PJRC
83 if (suspend && remote_wakeup) { 82 if (suspend && remote_wakeup) {
84 usb_remote_wakeup(); 83 usb_remote_wakeup();
85 } else { 84 } else {
86 usb_extra_system_send(SYSTEM_POWER_DOWN); 85 host_system_send(SYSTEM_POWER_DOWN);
87 } 86 }
87#else
88 host_system_send(SYSTEM_POWER_DOWN);
89#endif
88 _delay_ms(1000); 90 _delay_ms(1000);
89 } 91 }
90#endif 92#endif