summaryrefslogtreecommitdiff
path: root/ps2_vusb/led.c
diff options
context:
space:
mode:
Diffstat (limited to 'ps2_vusb/led.c')
-rw-r--r--ps2_vusb/led.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ps2_vusb/led.c b/ps2_vusb/led.c
new file mode 100644
index 0000000000..d69b1c6759
--- /dev/null
+++ b/ps2_vusb/led.c
@@ -0,0 +1,16 @@
+#include "stdint.h"
+#include "ps2.h"
+#include "led.h"
+
+
+void led_set(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);
+ ps2_host_set_led(ps2_led);
+}