logo

qmk_firmware

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

zeuspad.c (2059B)


  1. /* Copyright 2021 Koobaczech
  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. // 21 characters max
  18. #ifdef OLED_ENABLE
  19. bool oled_task_kb(void) {
  20. if (oled_task_user()) {
  21. return false;
  22. }
  23. oled_write_P(PSTR("ZEUSPAD BY KOOBACZECH"), false);
  24. // Keyboard Layer Status
  25. oled_write_P(PSTR("LAYER: "), false);
  26. switch (get_highest_layer(layer_state)) {
  27. case 1:
  28. oled_write_ln_P(PSTR("FN"), false);
  29. break;
  30. default:
  31. oled_write_ln_P(PSTR("Default"), false);
  32. }
  33. // Keyboard Locking Status
  34. led_t led_state = host_keyboard_led_state();
  35. oled_write_P(led_state.caps_lock ? PSTR("CAPS ") : PSTR(" "), false);
  36. oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
  37. oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
  38. switch (rgblight_is_enabled() ? 1 : 2) {
  39. case 1:
  40. // Or use the write_ln shortcut over adding '\n' to the end of your string
  41. oled_write_P(PSTR("RGB"), false);
  42. static char led_buf[30];
  43. snprintf(led_buf, sizeof(led_buf) - 1, "\nMODE:%2d BRIGHT:%2d/10", (uint8_t)(rgblight_get_mode()), (uint8_t)(rgblight_get_val() / 25.5));
  44. oled_write(led_buf, false);
  45. break;
  46. default:
  47. oled_write_ln_P(PSTR(""), false);
  48. oled_write_P(PSTR("\n"), false);
  49. }
  50. return true;
  51. }
  52. #endif