diff options
author | tmk <nobody@nowhere> | 2011-02-07 14:59:07 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2011-02-22 03:08:54 +0900 |
commit | 04f351b80279c55dfc6c8028f95eab7e01d50c84 (patch) | |
tree | 09e211eb1d1384d04374069e7e668b37a2f54bfd /ps2_vusb/keyboard.c | |
parent | 0632618d29dfb30c76b4e7c310dc7bee36919f63 (diff) |
PS/2 library receives data partially by interrupt
Diffstat (limited to 'ps2_vusb/keyboard.c')
-rw-r--r-- | ps2_vusb/keyboard.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ps2_vusb/keyboard.c b/ps2_vusb/keyboard.c index 95f65887f8..c480908f84 100644 --- a/ps2_vusb/keyboard.c +++ b/ps2_vusb/keyboard.c @@ -1,12 +1,30 @@ #include "usb_keycodes.h" #include "host.h" +#include "ps2.h" +#include "usb.h" #include "keyboard.h" +#include "print.h" static report_keyboard_t report0; static report_keyboard_t report1; static report_keyboard_t *report = &report0; static report_keyboard_t *report_prev = &report1; + +void keyboard_set_led(uint8_t usb_led) +{ + uint8_t ps2_led = 0; + if (usb_led & (1<<USB_LED_SCROLL_LOCK)) + ps2_led |= (1<<PS2_LED_SCROLL_LOCK); + if (usb_led & (1<<USB_LED_NUM_LOCK)) + ps2_led |= (1<<PS2_LED_NUM_LOCK); + if (usb_led & (1<<USB_LED_CAPS_LOCK)) + ps2_led |= (1<<PS2_LED_CAPS_LOCK); + print("ps2_led: "); phex(ps2_led); print("\n"); + + ps2_host_set_led(ps2_led); +} + void keyboard_send(void) { host_keyboard_send(report); |