You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
917 B

  1. #include "idb_60.h"
  2. void keyboard_pre_init_kb(void) {
  3. setPinOutput(C4);
  4. setPinOutput(C5);
  5. }
  6. inline void _idb_60_caps_led_on(void) {
  7. writePinLow(C5);
  8. }
  9. inline void _idb_60_fn_led_on(void) {
  10. writePinLow(C4);
  11. }
  12. inline void _idb_60_caps_led_off(void) {
  13. writePinHigh(C5);
  14. }
  15. inline void _idb_60_fn_led_off(void) {
  16. writePinHigh(C4);
  17. }
  18. // Capslock LED indicator
  19. bool led_update_kb(led_t led_state) {
  20. bool res = led_update_user(led_state);
  21. if (res) {
  22. if (led_state.caps_lock) {
  23. _idb_60_caps_led_on();
  24. } else {
  25. _idb_60_caps_led_off();
  26. }
  27. }
  28. return res;
  29. }
  30. // Layer LED indicator - drive LED when not on base layer
  31. __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
  32. if (get_highest_layer(state) == 0) {
  33. _idb_60_fn_led_off();
  34. } else {
  35. _idb_60_fn_led_on();
  36. }
  37. return state;
  38. }