Keyboard firmwares for Atmel AVR and Cortex-M
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }