summaryrefslogtreecommitdiff
path: root/common/keyboard.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2012-06-28 20:15:56 +0900
committertmk <nobody@nowhere>2012-06-28 20:15:56 +0900
commit3d81d5221eac9ca9620ba9043a250dcb8371b22e (patch)
treeae8f467e1691d42e01feaebc968aaade989924f3 /common/keyboard.c
parenta9a3610dd4a168e473d2d6a2eb3fbc37aabb46c9 (diff)
downloadqmk_firmware-3d81d5221eac9ca9620ba9043a250dcb8371b22e.tar.gz
qmk_firmware-3d81d5221eac9ca9620ba9043a250dcb8371b22e.zip
Add consumer/system control feature to LUFA.
Diffstat (limited to 'common/keyboard.c')
-rw-r--r--common/keyboard.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/common/keyboard.c b/common/keyboard.c
index 5c2643c951..25f32eb02f 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -49,6 +49,7 @@ void keyboard_proc(void)
uint8_t fn_bits = 0;
#ifdef EXTRAKEY_ENABLE
uint16_t consumer_code = 0;
+ uint16_t system_code = 0;
#endif
matrix_scan();
@@ -89,22 +90,13 @@ void keyboard_proc(void)
#ifdef HOST_PJRC
if (suspend && remote_wakeup) {
usb_remote_wakeup();
- } else {
- host_system_send(SYSTEM_POWER_DOWN);
}
-#else
- host_system_send(SYSTEM_POWER_DOWN);
#endif
- host_system_send(0);
- _delay_ms(500);
+ system_code = SYSTEM_POWER_DOWN;
} else if (code == KB_SYSTEM_SLEEP) {
- host_system_send(SYSTEM_SLEEP);
- host_system_send(0);
- _delay_ms(500);
+ system_code = SYSTEM_SLEEP;
} else if (code == KB_SYSTEM_WAKE) {
- host_system_send(SYSTEM_WAKE_UP);
- host_system_send(0);
- _delay_ms(500);
+ system_code = SYSTEM_WAKE_UP;
}
// Consumer Page
else if (code == KB_AUDIO_MUTE) {
@@ -173,6 +165,7 @@ void keyboard_proc(void)
host_send_keyboard_report();
#ifdef EXTRAKEY_ENABLE
host_consumer_send(consumer_code);
+ host_system_send(system_code);
#endif
#ifdef DEBUG_LED
// LED flash for debug