diff options
Diffstat (limited to 'users/ninjonas/oled.c')
-rw-r--r-- | users/ninjonas/oled.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/users/ninjonas/oled.c b/users/ninjonas/oled.c index ac98133bc7..285b0364e5 100644 --- a/users/ninjonas/oled.c +++ b/users/ninjonas/oled.c @@ -21,7 +21,7 @@ bool process_record_oled(uint16_t keycode, keyrecord_t *record) { return true; } -void render_default_layer_state(void) { +void render_layout_state(void) { oled_write_P(PSTR("Layout: "), false); switch (biton32(default_layer_state)) { case _COLEMAK: @@ -43,15 +43,23 @@ void oled_white_space(void){ } void render_layer_state(void) { - oled_write_P(PSTR("\nLayer: "), false); - oled_write_P(PSTR("LOW"), (layer_state_is(_LOWER) & !layer_state_is(_ADJUST))); - oled_white_space(); - oled_write_P(PSTR("RAI"), (layer_state_is(_RAISE) & !layer_state_is(_ADJUST))); - oled_white_space(); - oled_write_P(PSTR("ADJ"), layer_state_is(_ADJUST)); + oled_write_P(PSTR("\nLayer:"), false); + bool lower = layer_state_is(_LOWER) & !layer_state_is(_ADJUST); + bool raise = layer_state_is(_RAISE) & !layer_state_is(_ADJUST); + bool adjust = layer_state_is(_ADJUST); + + if(lower){ + oled_write_P(PSTR(" Lower "), true); + } else if(raise){ + oled_write_P(PSTR(" Raise "), true); + } else if(adjust){ + oled_write_P(PSTR(" Adjust "), true); + } else { + oled_write_P(PSTR(" Default"), false); + } } -void render_mod_status(uint8_t modifiers) { +void render_mod_state(uint8_t modifiers) { oled_write_P(PSTR("\nMods: "), false); oled_write_P(PSTR("SHF"), (modifiers & MOD_MASK_SHIFT)); oled_white_space(); @@ -63,10 +71,10 @@ void render_mod_status(uint8_t modifiers) { } void render_status(void){ - render_default_layer_state(); + render_layout_state(); oled_write_P(PSTR("\n"), false); render_layer_state(); - render_mod_status(get_mods()|get_oneshot_mods()); + render_mod_state(get_mods()|get_oneshot_mods()); } static void render_logo(void) { @@ -80,7 +88,7 @@ static void render_logo(void) { } void oled_task_user(void) { - if (timer_elapsed32(oled_timer) > 30000) { + if (timer_elapsed32(oled_timer) > 15000) { oled_off(); return; } |