logo

qmk_firmware

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

lulu.c (1020B)


  1. // Copyright 2022 Cole Smith <cole@boadsource.xyz>
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "quantum.h"
  4. #include "lib/oled.h"
  5. #ifdef ENCODER_ENABLE
  6. bool encoder_update_kb(uint8_t index, bool clockwise) {
  7. if (!encoder_update_user(index, clockwise)) { return false; }
  8. if (index == 0) {
  9. if (clockwise) {
  10. tap_code(KC_VOLU);
  11. } else {
  12. tap_code(KC_VOLD);
  13. }
  14. } else if (index == 1) {
  15. if (clockwise) {
  16. tap_code(KC_PGDN);
  17. } else {
  18. tap_code(KC_PGUP);
  19. }
  20. }
  21. return true;
  22. }
  23. #endif
  24. #ifdef OLED_ENABLE
  25. oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
  26. if (!is_keyboard_master()) {
  27. return OLED_ROTATION_180;
  28. }
  29. return rotation;
  30. }
  31. bool oled_task_kb(void) {
  32. if (!oled_task_user()) {
  33. return false;
  34. }
  35. if (is_keyboard_master()) {
  36. render_layer_state();
  37. } else {
  38. oled_write_raw_P(bs_logo_img, sizeof(bs_logo_img));
  39. }
  40. return false;
  41. }
  42. #endif