toad.c 352 B

123456789101112131415161718
  1. #include "toad.h"
  2. void led_set_user(uint8_t usb_led) {
  3. //LED1
  4. if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
  5. DDRB |= (1 << 6); PORTB &= ~(1 << 6);
  6. } else {
  7. DDRB &= ~(1 << 6); PORTB &= ~(1 << 6);
  8. }
  9. //LED2
  10. if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
  11. DDRB |= (1 << 5); PORTB &= ~(1 << 5);
  12. } else {
  13. DDRB &= ~(1 << 5); PORTB &= ~(1 << 5);
  14. }
  15. }