logo

qmk_firmware

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

udon13.c (3075B)


  1. // Copyright 2023 The Mad Noodle(@the_mad_noodle)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "quantum.h"
  4. #ifdef OLED_ENABLE
  5. /* OLED Settings */
  6. //------------------------------------------------------------------------------------------------
  7. static void render_logo(void) { // Render Mad Noodle logo
  8. static const char PROGMEM logo_1[] = {0x00, 0x00, 0x80, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x04, 0x06, 0x82, 0xc3, 0x43, 0x61, 0xa1, 0xa1, 0xa1, 0xa1, 0x61, 0x43, 0xc3, 0x82, 0x06, 0x04, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00};
  9. static const char PROGMEM logo_2[] = {0xf8, 0x1e, 0xc3, 0xf8, 0x5c, 0x76, 0x7b, 0x6d, 0x75, 0x55, 0x55, 0x75, 0x6d, 0x7b, 0x76, 0x5e, 0x7e, 0x77, 0x5b, 0x6d, 0x75, 0x55, 0x55, 0x75, 0x4d, 0x7b, 0x66, 0x5c, 0xf0, 0xc3, 0x3e, 0xf0};
  10. static const char PROGMEM logo_3[] = {0x1f, 0x78, 0xc1, 0x0f, 0x38, 0xe0, 0xc0, 0x00, 0x00, 0x02, 0x0e, 0x0e, 0x8e, 0xc6, 0xc0, 0x40, 0x40, 0xc0, 0xc6, 0x8e, 0x0e, 0x0e, 0x02, 0x00, 0x80, 0xc0, 0x60, 0x38, 0x0f, 0xc0, 0x7c, 0x0f};
  11. static const char PROGMEM logo_4[] = {0x00, 0x00, 0x01, 0x03, 0x06, 0x0c, 0x18, 0x31, 0x23, 0x66, 0x44, 0x44, 0xc4, 0xc4, 0x84, 0x84, 0x84, 0x84, 0xc4, 0xc4, 0x44, 0x46, 0x66, 0x23, 0x11, 0x18, 0x0c, 0x06, 0x03, 0x00, 0x00, 0x00};
  12. oled_set_cursor(0, 0);
  13. oled_write_raw_P(logo_1, sizeof(logo_1));
  14. oled_set_cursor(0, 1);
  15. oled_write_raw_P(logo_2, sizeof(logo_2));
  16. oled_set_cursor(0, 2);
  17. oled_write_raw_P(logo_3, sizeof(logo_3));
  18. oled_set_cursor(0, 3);
  19. oled_write_raw_P(logo_4, sizeof(logo_4));
  20. }
  21. //-----------
  22. bool oled_task_kb(void) {
  23. if (!oled_task_user()) { return false; }
  24. render_logo();
  25. oled_set_cursor(7, 0);
  26. oled_write_P(PSTR("The Mad Noodle"), false);
  27. oled_set_cursor(7, 1);
  28. oled_write_P(PSTR("Layer: "), false);
  29. /*
  30. To change LAYER NAMES displayed on the OLED ensure they are a total of 6 characters, including spaces.
  31. Example:
  32. ---------------------------------------------------
  33. case 0:
  34. oled_write_P(PSTR("Base "), false);
  35. break;
  36. ---------------------------------------------------
  37. "B A S E *SPACE* *SPACE*" = 6 characters
  38. This would change layer 0 to Base on the OLED
  39. */
  40. switch (get_highest_layer(layer_state)) {
  41. case 0:
  42. oled_write_P(PSTR("Zero "), false);
  43. break;
  44. case 1:
  45. oled_write_P(PSTR("One "), false);
  46. break;
  47. case 2:
  48. oled_write_P(PSTR("Two "), false);
  49. break;
  50. case 3:
  51. oled_write_P(PSTR("Three "), false);
  52. break;
  53. default:
  54. oled_write_P(PSTR("N/A "), false);
  55. }
  56. oled_set_cursor(7, 2);
  57. oled_write_P(PSTR("Status: "), false);
  58. oled_set_cursor(7, 3);
  59. led_t led_state = host_keyboard_led_state();
  60. oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
  61. oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
  62. oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
  63. return false;
  64. }
  65. #endif