rev4.c 594 B

123456789101112131415161718192021222324
  1. #include "rev4.h"
  2. void led_init_ports(void) {
  3. // Set our LED pins as output
  4. setPinOutput(B13); // LED1
  5. writePinLow(B13);
  6. setPinOutput(B14); // LED2
  7. writePinLow(B14);
  8. setPinOutput(A8); // LED3
  9. writePinLow(A8);
  10. setPinOutput(A0); // Capslock LED
  11. writePinLow(A0);
  12. }
  13. bool led_update_kb(led_t led_state) {
  14. bool res = led_update_user(led_state);
  15. if(res) {
  16. writePin(B13, led_state.num_lock);
  17. writePin(A0, led_state.caps_lock);
  18. writePin(B14, led_state.caps_lock);
  19. writePin(A8, led_state.scroll_lock);
  20. }
  21. return res;
  22. }