logo

qmk_firmware

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

glitch.c (1717B)


  1. /* Copyright 2021 Matthew Dias
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "quantum.h"
  17. #ifdef ENCODER_ENABLE
  18. bool encoder_update_kb(uint8_t index, bool clockwise) {
  19. if (!encoder_update_user(index, clockwise)) {
  20. return false;
  21. }
  22. if (clockwise) {
  23. rgblight_step();
  24. } else {
  25. rgblight_step_reverse();
  26. }
  27. return false;
  28. }
  29. #endif
  30. #ifdef OLED_ENABLE
  31. bool oled_task_kb(void) {
  32. if (!oled_task_user()) {
  33. return false;
  34. }
  35. // Host Keyboard Layer Status
  36. oled_write_P(PSTR("Layer: "), false);
  37. switch (get_highest_layer(layer_state)) {
  38. case 0:
  39. oled_write_P(PSTR("Default\n"), false);
  40. break;
  41. default:
  42. oled_write_P(PSTR("Undefined\n"), false);
  43. }
  44. // Host Keyboard LED Status
  45. led_t led_state = host_keyboard_led_state();
  46. oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
  47. oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
  48. oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
  49. return false;
  50. }
  51. #endif