melody96.c 476 B

12345678910111213141516171819202122
  1. #include "melody96.h"
  2. void led_set_user(uint8_t usb_led) {
  3. if (usb_led & (1 << USB_LED_NUM_LOCK)) {
  4. DDRC |= (1 << 6); PORTC &= ~(1 << 6);
  5. } else {
  6. DDRC &= ~(1 << 6); PORTC &= ~(1 << 6);
  7. }
  8. if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
  9. DDRC |= (1 << 7); PORTC &= ~(1 << 7);
  10. } else {
  11. DDRC &= ~(1 << 7); PORTC &= ~(1 << 7);
  12. }
  13. if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
  14. DDRB |= (1 << 5); PORTB &= ~(1 << 5);
  15. } else {
  16. DDRB &= ~(1 << 5); PORTB &= ~(1 << 5);
  17. }
  18. }