logo

qmk_firmware

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

rartland.c (1616B)


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