diff options
author | Manna Harbour <51143715+manna-harbour@users.noreply.github.com> | 2019-12-08 18:08:12 +1100 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-12-07 23:08:12 -0800 |
commit | 3d78e6078e402bf0fe476adeed8ac16033f916c0 (patch) | |
tree | 8b49da26c139bacb17b1b3c3af370658f16f5ec8 /keyboards/crkbd | |
parent | e676278474b853fb16187e605c037930c4927144 (diff) | |
download | qmk_firmware-3d78e6078e402bf0fe476adeed8ac16033f916c0.tar.gz qmk_firmware-3d78e6078e402bf0fe476adeed8ac16033f916c0.zip |
[Keymap] Display logo for caps lock indication on crkbd using old OLED driver (#7535)
* Display logo for caps lock indication on crkbd using old OLED driver
* Add emacs read-only mode file variable to generated files
* use LTO_ENABLE instead of EXTRAFLAGS
This enables the same option, and disables action_macros, and action_functions, both of which seem to break when LTO is enabled. And this is a lot simpler to use.
Co-Authored-By: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/crkbd')
-rw-r--r-- | keyboards/crkbd/keymaps/manna-harbour_miryoku/config.h | 5 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c | 41 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/manna-harbour_miryoku/rules.mk | 7 |
3 files changed, 47 insertions, 6 deletions
diff --git a/keyboards/crkbd/keymaps/manna-harbour_miryoku/config.h b/keyboards/crkbd/keymaps/manna-harbour_miryoku/config.h index 4b8f78a650..e2fe1824da 100644 --- a/keyboards/crkbd/keymaps/manna-harbour_miryoku/config.h +++ b/keyboards/crkbd/keymaps/manna-harbour_miryoku/config.h @@ -1,5 +1,4 @@ - -// generated from users/manna-harbour_miryoku/miryoku.org +// generated from users/manna-harbour_miryoku/miryoku.org -*- buffer-read-only: t -*- #pragma once @@ -15,3 +14,5 @@ #define RGB_MATRIX_VAL_STEP 8 #define RGB_MATRIX_SPD_STEP 10 #endif + +#define SSD1306OLED // old oled driver diff --git a/keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c b/keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c index 56d4de25ac..f5be6844f8 100644 --- a/keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c +++ b/keyboards/crkbd/keymaps/manna-harbour_miryoku/keymap.c @@ -1,5 +1,4 @@ - -// generated from users/manna-harbour_miryoku/miryoku.org +// generated from users/manna-harbour_miryoku/miryoku.org -*- buffer-read-only: t -*- #define LAYOUT_miryoku( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ @@ -15,3 +14,41 @@ KC_NO, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_ ) #include "manna-harbour_miryoku.c" + + +#ifdef SSD1306OLED + +#include "ssd1306.h" + +void matrix_init_user(void) { + iota_gfx_init(!has_usb()); // turns on the display +} + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_logo(void); + +void matrix_scan_user(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} + +#endif //SSD1306OLED diff --git a/keyboards/crkbd/keymaps/manna-harbour_miryoku/rules.mk b/keyboards/crkbd/keymaps/manna-harbour_miryoku/rules.mk index f62c86e932..c4fb15f342 100644 --- a/keyboards/crkbd/keymaps/manna-harbour_miryoku/rules.mk +++ b/keyboards/crkbd/keymaps/manna-harbour_miryoku/rules.mk @@ -1,4 +1,7 @@ - -# generated from users/manna-harbour_miryoku/miryoku.org +# generated from users/manna-harbour_miryoku/miryoku.org -*- buffer-read-only: t -*- RGB_MATRIX_ENABLE = WS2812 + +# old oled driver +SRC += ./lib/glcdfont.c \ + ./lib/logo_reader.c |