knight.c 493 B

1234567891011121314151617181920212223
  1. #include "knight.h"
  2. void matrix_init_kb(void) {
  3. // put your keyboard start-up code here
  4. // runs once when the firmware starts up
  5. matrix_init_user();
  6. led_init_ports();
  7. }
  8. void led_init_ports(void) {
  9. setPinOutput(D1);
  10. writePinHigh(D1);
  11. setPinOutput(E2);
  12. writePinHigh(E2);
  13. }
  14. bool led_update_kb(led_t led_state) {
  15. if(led_update_user(led_state)) {
  16. writePin(E2, !led_state.caps_lock);
  17. writePin(D1, !led_state.num_lock);
  18. }
  19. return true;
  20. }