summaryrefslogtreecommitdiff
path: root/ps2_usb/led.c
blob: d69b1c6759dea7302ed4fb046cf0eb27d4d21340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
}