rev4.c 668 B

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