rev1.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "rev1.h"
  2. void eeconfig_init_kb(void) {
  3. #ifdef BACKLIGHT_ENABLE
  4. backlight_enable();
  5. backlight_level(5);
  6. #endif
  7. #ifdef RGBLIGHT_ENABLE
  8. rgblight_enable(); // Enable RGB by default
  9. rgblight_sethsv(0, 255, 255); // Set default HSV - red hue, full saturation, full brightness
  10. #ifdef RGBLIGHT_ANIMATIONS
  11. rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2); // set to RGB_RAINBOW_SWIRL by default
  12. #endif
  13. #endif
  14. eeconfig_update_kb(0);
  15. eeconfig_init_user();
  16. }
  17. bool encoder_update_kb(uint8_t index, bool clockwise) {
  18. if (!encoder_update_user(index, clockwise)) { return false; }
  19. if (index == 0) {
  20. if (clockwise) {
  21. tap_code(KC_VOLU);
  22. } else {
  23. tap_code(KC_VOLD);
  24. }
  25. }
  26. else if (index == 1) {
  27. if (clockwise) {
  28. tap_code(KC_DOWN);
  29. } else {
  30. tap_code(KC_UP);
  31. }
  32. }
  33. else if (index == 2) {
  34. if (clockwise) {
  35. tap_code(KC_PGDN);
  36. } else {
  37. tap_code(KC_PGUP);
  38. }
  39. }
  40. return false;
  41. }