keymap.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // generated from users/manna-harbour_miryoku/miryoku.org -*- buffer-read-only: t -*-
  2. #define LAYOUT_miryoku( \
  3. K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \
  4. K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \
  5. K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \
  6. N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \
  7. ) \
  8. LAYOUT( \
  9. KC_NO, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_NO, \
  10. KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, \
  11. KC_NO, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO, \
  12. K32, K33, K34, K35, K36, K37 \
  13. )
  14. #include "manna-harbour_miryoku.c"
  15. #ifdef SSD1306OLED
  16. #include "ssd1306.h"
  17. void matrix_init_user(void) {
  18. iota_gfx_init(!has_usb()); // turns on the display
  19. }
  20. // When add source files to SRC in rules.mk, you can use functions.
  21. const char *read_logo(void);
  22. void matrix_scan_user(void) {
  23. iota_gfx_task();
  24. }
  25. void matrix_render_user(struct CharacterMatrix *matrix) {
  26. if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
  27. matrix_write(matrix, read_logo());
  28. }
  29. }
  30. void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) {
  31. if (memcmp(dest->display, source->display, sizeof(dest->display))) {
  32. memcpy(dest->display, source->display, sizeof(dest->display));
  33. dest->dirty = true;
  34. }
  35. }
  36. void iota_gfx_task_user(void) {
  37. struct CharacterMatrix matrix;
  38. matrix_clear(&matrix);
  39. matrix_render_user(&matrix);
  40. matrix_update(&display, &matrix);
  41. }
  42. #endif //SSD1306OLED