From 087af43dee545792f486069481460ed5997bc41b Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 12 Jul 2017 12:10:28 -0400 Subject: fix implementation issues from SSD1306 clean up, added rotation (#1494) * moved OLED update task to keymap * fix splitting render display to keymap * Added rotation option for OLED, fixed splitting display render update to keymap * issues with attribute --- keyboards/lets_split/keymaps/OLED_sample/config.h | 1 + keyboards/lets_split/keymaps/OLED_sample/keymap.c | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'keyboards/lets_split') diff --git a/keyboards/lets_split/keymaps/OLED_sample/config.h b/keyboards/lets_split/keymaps/OLED_sample/config.h index c7cbc9372..57ed7d763 100644 --- a/keyboards/lets_split/keymaps/OLED_sample/config.h +++ b/keyboards/lets_split/keymaps/OLED_sample/config.h @@ -36,6 +36,7 @@ along with this program. If not, see . #define FLIP_HALF #define SSD1306OLED +//#define OLED_ROTATE180 #define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/lets_split/keymaps/OLED_sample/keymap.c b/keyboards/lets_split/keymaps/OLED_sample/keymap.c index ad32269c8..9553309f8 100644 --- a/keyboards/lets_split/keymaps/OLED_sample/keymap.c +++ b/keyboards/lets_split/keymaps/OLED_sample/keymap.c @@ -358,6 +358,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; } + void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { @@ -366,6 +367,17 @@ void matrix_update(struct CharacterMatrix *dest, } } +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_FNLAYER 64 +#define L_NUMLAY 128 +#define L_NLOWER 136 +#define L_NFNLAYER 192 +#define L_MOUSECURSOR 256 +#define L_ADJUST 65560 + void iota_gfx_task_user(void) { #if DEBUG_TO_SCREEN if (debug_enable) { @@ -408,18 +420,16 @@ void iota_gfx_task_user(void) { snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); matrix_write_P(&matrix, PSTR("\n\nLayer: ")); switch (layer_state) { - case _QWERTY: - case _COLEMAK: - case _DVORAK: + case L_BASE: matrix_write_P(&matrix, PSTR("Default")); break; - case _RAISE: + case L_RAISE: matrix_write_P(&matrix, PSTR("Raise")); break; - case _LOWER: + case L_LOWER: matrix_write_P(&matrix, PSTR("Lower")); break; - case _ADJUST: + case L_ADJUST: matrix_write_P(&matrix, PSTR("ADJUST")); break; default: -- cgit v1.2.3