1
0
Fork 0

Added PS/2 multimeda key support.

HID Consumer page and System control are also supported now.
merged mediakey branch: d53a356cd2011b461843a5c7c1527a61692893c1
This commit is contained in:
tmk 2011-05-31 21:17:56 +09:00
parent af85b6bba6
commit 6d45e05ede
10 changed files with 447 additions and 350 deletions

View file

@ -1,8 +1,10 @@
#include <util/delay.h>
#include <avr/interrupt.h>
#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);
}