From 6d45e05ede8ea1a96df9a04d58a7d7ede51afd9b Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 31 May 2011 21:17:56 +0900 Subject: Added PS/2 multimeda key support. HID Consumer page and System control are also supported now. merged mediakey branch: d53a356cd2011b461843a5c7c1527a61692893c1 --- pjrc/usb_extra.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'pjrc/usb_extra.c') diff --git a/pjrc/usb_extra.c b/pjrc/usb_extra.c index 9bc0c3f5f3..670d01e932 100644 --- a/pjrc/usb_extra.c +++ b/pjrc/usb_extra.c @@ -1,8 +1,10 @@ +#include #include +#include "host.h" #include "usb_extra.h" -int8_t usb_extra_send(uint8_t report_id, uint8_t bits) +int8_t usb_extra_send(uint8_t report_id, uint16_t data) { uint8_t intr_state, timeout; @@ -26,19 +28,20 @@ int8_t usb_extra_send(uint8_t report_id, uint8_t bits) } UEDATX = report_id; - UEDATX = bits; + UEDATX = data&0xFF; + UEDATX = (data>>8)&0xFF; UEINTX = 0x3A; SREG = intr_state; return 0; } -int8_t usb_extra_audio_send(uint8_t bits) +int8_t usb_extra_consumer_send(uint16_t bits) { - return usb_extra_send(1, bits); + return usb_extra_send(REPORT_ID_CONSUMER, bits); } -int8_t usb_extra_system_send(uint8_t bits) +int8_t usb_extra_system_send(uint16_t bits) { - return usb_extra_send(2, bits); + return usb_extra_send(REPORT_ID_SYSTEM, bits); } -- cgit v1.2.1