logo

qmk_firmware

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

rev2.c (2100B)


  1. /* Copyright 2022 Kyle McCreery
  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 OLED_ENABLE
  18. static const char PROGMEM mw_logo[] = {
  19. 0x8A, 0x8B, 0x8C, 0x8D, '\r',
  20. 0xAA, 0xAB, 0xAC, 0xAD, 0xAE,
  21. 0xCA, 0xCB, 0xCC, 0xCD, '\r',
  22. 0x20, 0x8E, 0x8F, 0x90, 0x00};
  23. oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
  24. return OLED_ROTATION_270; // flips the display 270 degrees
  25. }
  26. bool oled_task_kb(void) {
  27. if (!oled_task_user()) {
  28. return false;
  29. }
  30. oled_write_P(mw_logo, false); // Render MechWild "MW" Logo
  31. oled_set_cursor(0,6);
  32. oled_write_ln_P(PSTR("Layer"), false);
  33. switch (get_highest_layer(layer_state)) {
  34. case 0:
  35. oled_write_ln_P(PSTR("Base"), false);
  36. break;
  37. case 1:
  38. oled_write_ln_P(PSTR("FN 1"), false);
  39. break;
  40. case 2:
  41. oled_write_ln_P(PSTR("FN 2"), false);
  42. break;
  43. case 3:
  44. oled_write_ln_P(PSTR("FN 3"), false);
  45. break;
  46. default:
  47. oled_write_ln_P(PSTR("Undef"), false);
  48. }
  49. oled_write_ln_P(PSTR(""), false);
  50. // Host Keyboard LED Status
  51. led_t led_state = host_keyboard_led_state();
  52. oled_write_ln_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
  53. oled_write_ln_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
  54. oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
  55. return true;
  56. }
  57. #endif