planck.c 980 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "planck.h"
  2. __attribute__ ((weak))
  3. void matrix_init_kb(void) {
  4. // Turn status LED on, with the exception of THK
  5. #if defined(__AVR_ATmega32U4__)
  6. setPinOutput(E6);
  7. writePinHigh(E6);
  8. #endif
  9. matrix_init_user();
  10. }
  11. const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_planck_grid(
  12. 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  13. 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
  14. 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
  15. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
  16. );
  17. #ifdef ENCODER_ENABLE
  18. bool encoder_update_kb(uint8_t index, bool clockwise) {
  19. if (!encoder_update_user(index, clockwise)) { return false; }
  20. if (get_highest_layer(layer_state) > 0) {
  21. if (clockwise) {
  22. tap_code_delay(KC_VOLU, 10);
  23. } else {
  24. tap_code_delay(KC_VOLD, 10);
  25. }
  26. } else {
  27. if (clockwise) {
  28. tap_code(KC_PGDN);
  29. } else {
  30. tap_code(KC_PGUP);
  31. }
  32. }
  33. return true;
  34. }
  35. #endif