rev2.c 825 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2025 Keebio (@keebio)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "quantum.h"
  4. void keyboard_pre_init_kb(void) {
  5. // Disable the PD peripheral in pre-init because its pins are being used in the matrix:
  6. PWR->CR3 |= PWR_CR3_UCPD_DBDIS;
  7. // Call the corresponding _user() function (see https://docs.qmk.fm/#/custom_quantum_functions)
  8. keyboard_pre_init_user();
  9. }
  10. bool encoder_update_kb(uint8_t index, bool clockwise) {
  11. if (!encoder_update_user(index, clockwise)) { return false; }
  12. if (index == 0) {
  13. if (clockwise) {
  14. tap_code(KC_VOLU);
  15. } else {
  16. tap_code(KC_VOLD);
  17. }
  18. } else if (index == 1) {
  19. if (clockwise) {
  20. tap_code(KC_PGDN);
  21. } else {
  22. tap_code(KC_PGUP);
  23. }
  24. }
  25. return false;
  26. }