Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

led.c 406B

12345678910111213141516
  1. #include "stdint.h"
  2. #include "ps2.h"
  3. #include "led.h"
  4. void led_set(uint8_t usb_led)
  5. {
  6. uint8_t ps2_led = 0;
  7. if (usb_led & (1<<USB_LED_SCROLL_LOCK))
  8. ps2_led |= (1<<PS2_LED_SCROLL_LOCK);
  9. if (usb_led & (1<<USB_LED_NUM_LOCK))
  10. ps2_led |= (1<<PS2_LED_NUM_LOCK);
  11. if (usb_led & (1<<USB_LED_CAPS_LOCK))
  12. ps2_led |= (1<<PS2_LED_CAPS_LOCK);
  13. ps2_host_set_led(ps2_led);
  14. }