aboutsummaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-04-04 22:29:40 +0300
committerFred Sundvik <fsundvik@gmail.com>2017-04-09 18:34:59 +0300
commit05bc4880ddc9e904cfa1773caff1ae81977d2a76 (patch)
tree1dd6d75c3725a0002fa352746c543e8d4d77fd25 /quantum
parentfa6da78ff3c96a71ed65684e276352700843d539 (diff)
downloadfirmware-05bc4880ddc9e904cfa1773caff1ae81977d2a76.tar.gz
firmware-05bc4880ddc9e904cfa1773caff1ae81977d2a76.tar.bz2
firmware-05bc4880ddc9e904cfa1773caff1ae81977d2a76.zip
Tweaks to the Ergodox default visualizer
No animation, display led statuses and layer name on the same screen Don't display layer bitmap Fully saturated colors for caps, less saturated ones normally
Diffstat (limited to 'quantum')
-rw-r--r--quantum/visualizer/visualizer.c28
-rw-r--r--quantum/visualizer/visualizer.h1
2 files changed, 26 insertions, 3 deletions
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c
index 3b3f51b1f..2533eb709 100644
--- a/quantum/visualizer/visualizer.c
+++ b/quantum/visualizer/visualizer.c
@@ -364,9 +364,9 @@ bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_st
return false;
}
-bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state)
-{
- char output[sizeof("NUM CAPS SCRL COMP KANA")];
+#define LED_STATE_STRING_SIZE sizeof("NUM CAPS SCRL COMP KANA")
+
+static void get_led_state_string(char* output, visualizer_state_t* state) {
uint8_t pos = 0;
if (state->status.leds & (1u << USB_LED_NUM_LOCK)) {
@@ -390,12 +390,34 @@ bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_sta
pos += 5;
}
output[pos] = 0;
+}
+
+bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state)
+{
+ (void)animation;
+ char output[LED_STATE_STRING_SIZE];
+ get_led_state_string(output, state);
gdispClear(White);
gdispDrawString(0, 10, output, state->font_dejavusansbold12, Black);
gdispFlush();
return false;
}
+bool keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)animation;
+ gdispClear(White);
+ uint8_t y = 10;
+ if (state->status.leds) {
+ char output[LED_STATE_STRING_SIZE];
+ get_led_state_string(output, state);
+ gdispDrawString(0, 1, output, state->font_dejavusansbold12, Black);
+ y = 17;
+ }
+ gdispDrawString(0, y, state->layer_text, state->font_dejavusansbold12, Black);
+ gdispFlush();
+ return false;
+}
+
#endif // LCD_ENABLE
bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h
index e8ace5b37..3b05c305e 100644
--- a/quantum/visualizer/visualizer.h
+++ b/quantum/visualizer/visualizer.h
@@ -141,6 +141,7 @@ bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_s
bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state);
// Displays the keyboard led states (CAPS (Caps lock), NUM (Num lock), SCRL (Scroll lock), COMP (Compose), KANA)
bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
+bool keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state);
bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state);