logo

qmk_firmware

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

oled.c (2258B)


  1. /* Copyright 2021 Yang Hu
  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. #ifdef OLED_ENABLE
  17. # include QMK_KEYBOARD_H
  18. # include "layers.h"
  19. // Some characters position:
  20. // alt: 84 85 86/a..../c...
  21. // shift:87 88 89/a.../c...
  22. // ctrl: b6 b6/d.../
  23. // capslock: 9c-9f/b.../d...
  24. // numlock: 98-9b/b.../d...
  25. // navigation logo: 92-95/b2.../d2...
  26. // symbol logo: 8a-8d/aa..../ca....
  27. // qmk logos; 8e-91/ae..../ce....
  28. void oled_render_layer(void) {
  29. /* static const char PROGMEM cmd_logo[] = { */
  30. /* 0x80, 0x81, 0x82, 0x83, 10, */
  31. /* 0xa0, 0xa1, 0xa2, 0xa3, 10, */
  32. /* 0xc0, 0xc1, 0xc2, 0xc3, 10, */
  33. /* 0}; */
  34. // clang-format off
  35. static const char PROGMEM numlock_logo[] = {
  36. 0x98, 0x99, 0x9a, 0x9b, 10,
  37. 0xb8, 0xb9, 0xba, 0xbb, 10,
  38. 0xd8, 0xd9, 0xda, 0xdb, 10, 0};
  39. static const char PROGMEM symbol_logo[] = {
  40. 0x8a, 0x8b, 0x8c, 0x8d, 10,
  41. 0xaa, 0xab, 0xac, 0xad, 10,
  42. 0xca, 0xcb, 0xcc, 0xcd, 10, 0};
  43. static const char PROGMEM qmk_logo[] = {
  44. 0x8e, 0x8f, 0x90, 0x91, 10,
  45. 0xae, 0xaf, 0xb0, 0xb1, 10,
  46. 0xce, 0xcf, 0xd0, 0xd1, 10, 0};
  47. // clang-format on
  48. if (IS_LAYER_ON(_LOWER)) {
  49. oled_write_P(symbol_logo, false);
  50. } else if (IS_LAYER_ON(_RAISE)) {
  51. oled_write_P(numlock_logo, false);
  52. } else if (IS_LAYER_ON(_BASE)) {
  53. oled_write_P(qmk_logo, false);
  54. } else {
  55. if (IS_LAYER_ON(_ADJUST)) {
  56. oled_write_ln("ADJ", false);
  57. } else {
  58. oled_write_ln("?????", false);
  59. }
  60. oled_write_ln(" ", false);
  61. oled_write_ln(" ", false);
  62. oled_write_ln(" ", false);
  63. }
  64. }
  65. #endif