You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.4 KiB

  1. /* Copyright 2021 takashicompany
  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. oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
  18. return OLED_ROTATION_270;
  19. }
  20. //Variable that stores the number of times the key was pressed
  21. static uint16_t press_count = 0;
  22. bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
  23. // Increment the counter when a key is pressed
  24. if (record->event.pressed) {
  25. press_count++;
  26. }
  27. return process_record_user(keycode, record);
  28. }
  29. #ifdef OLED_ENABLE
  30. bool oled_task_kb(void) {
  31. if (!oled_task_user()) { return false; }
  32. static const char PROGMEM my_logo[] = {
  33. 0x00, 0x00, 0x00, 0xff, 0x01, 0x01, 0x39, 0x29, 0x29, 0x29, 0x29, 0x29, 0xe9, 0x0f, 0x00, 0x00,
  34. 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf8, 0x08, 0xf8, 0x00, 0x00, 0x00, 0x00,
  35. 0x80, 0x80, 0x80, 0xbf, 0xa0, 0xa0, 0xa7, 0xa5, 0xa5, 0xa5, 0xa5, 0x25, 0x25, 0x3c, 0x00, 0x1f,
  36. 0x20, 0x3e, 0x02, 0x3e, 0x20, 0x1f, 0x20, 0x2e, 0x2a, 0x2e, 0x20, 0x1f, 0x00, 0x00, 0x00, 0x00,
  37. 0x87, 0x44, 0x24, 0x14, 0x0c, 0x00, 0xc0, 0xa0, 0x90, 0x88, 0x87, 0x00, 0xe0, 0x10, 0xd0, 0x50,
  38. 0xd0, 0x10, 0xe0, 0x10, 0xd0, 0x50, 0xd0, 0x10, 0xe0, 0x10, 0xd0, 0x50, 0x50, 0x10, 0xf0, 0x00,
  39. 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x03, 0x04, 0x05, 0x05,
  40. 0x05, 0x04, 0x03, 0x04, 0x07, 0x00, 0x07, 0x04, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x07, 0x00
  41. };
  42. oled_write_raw_P(my_logo, sizeof(my_logo));
  43. oled_set_cursor(0, 5);
  44. oled_write_ln_P(PSTR("Layer"), false);
  45. oled_write_ln(get_u8_str(get_highest_layer(layer_state), ' '), false);
  46. oled_write_ln_P(PSTR(" "), false);
  47. oled_write_ln_P(PSTR(" "), false);
  48. oled_write_ln_P(PSTR("Count"), false);
  49. oled_write_ln(get_u16_str(press_count, ' '), false);
  50. return false;
  51. }
  52. #endif