rev4.c 942 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "rev4.h"
  2. void eeconfig_init_kb(void) {
  3. #ifdef BACKLIGHT_ENABLE
  4. backlight_enable();
  5. backlight_level(3);
  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. #ifdef ENCODER_ENABLE
  18. bool encoder_update_kb(uint8_t index, bool clockwise) {
  19. if (!encoder_update_user(index, clockwise)) { return false; }
  20. if (index == 0) {
  21. if (clockwise) {
  22. tap_code(KC_VOLU);
  23. } else {
  24. tap_code(KC_VOLD);
  25. }
  26. } else if (index == 1) {
  27. if (clockwise) {
  28. tap_code(KC_PGDN);
  29. } else {
  30. tap_code(KC_PGUP);
  31. }
  32. }
  33. return false;
  34. }
  35. #endif