logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

planck.c (724B)


  1. #include "quantum.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. gpio_set_pin_output(E6);
  7. gpio_write_pin_high(E6);
  8. #endif
  9. matrix_init_user();
  10. }
  11. #ifdef ENCODER_ENABLE
  12. bool encoder_update_kb(uint8_t index, bool clockwise) {
  13. if (!encoder_update_user(index, clockwise)) { return false; }
  14. if (get_highest_layer(layer_state) > 0) {
  15. if (clockwise) {
  16. tap_code_delay(KC_VOLU, 10);
  17. } else {
  18. tap_code_delay(KC_VOLD, 10);
  19. }
  20. } else {
  21. if (clockwise) {
  22. tap_code(KC_PGDN);
  23. } else {
  24. tap_code(KC_PGUP);
  25. }
  26. }
  27. return true;
  28. }
  29. #endif