diff options
Diffstat (limited to 'quantum/visualizer/visualizer.c')
-rw-r--r-- | quantum/visualizer/visualizer.c | 28 |
1 files changed, 25 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 | |||
364 | return false; | 364 | return false; |
365 | } | 365 | } |
366 | 366 | ||
367 | bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state) | 367 | #define LED_STATE_STRING_SIZE sizeof("NUM CAPS SCRL COMP KANA") |
368 | { | 368 | |
369 | char output[sizeof("NUM CAPS SCRL COMP KANA")]; | 369 | static void get_led_state_string(char* output, visualizer_state_t* state) { |
370 | uint8_t pos = 0; | 370 | uint8_t pos = 0; |
371 | 371 | ||
372 | if (state->status.leds & (1u << USB_LED_NUM_LOCK)) { | 372 | if (state->status.leds & (1u << USB_LED_NUM_LOCK)) { |
@@ -390,12 +390,34 @@ bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_sta | |||
390 | pos += 5; | 390 | pos += 5; |
391 | } | 391 | } |
392 | output[pos] = 0; | 392 | output[pos] = 0; |
393 | } | ||
394 | |||
395 | bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state) | ||
396 | { | ||
397 | (void)animation; | ||
398 | char output[LED_STATE_STRING_SIZE]; | ||
399 | get_led_state_string(output, state); | ||
393 | gdispClear(White); | 400 | gdispClear(White); |
394 | gdispDrawString(0, 10, output, state->font_dejavusansbold12, Black); | 401 | gdispDrawString(0, 10, output, state->font_dejavusansbold12, Black); |
395 | gdispFlush(); | 402 | gdispFlush(); |
396 | return false; | 403 | return false; |
397 | } | 404 | } |
398 | 405 | ||
406 | bool keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
407 | (void)animation; | ||
408 | gdispClear(White); | ||
409 | uint8_t y = 10; | ||
410 | if (state->status.leds) { | ||
411 | char output[LED_STATE_STRING_SIZE]; | ||
412 | get_led_state_string(output, state); | ||
413 | gdispDrawString(0, 1, output, state->font_dejavusansbold12, Black); | ||
414 | y = 17; | ||
415 | } | ||
416 | gdispDrawString(0, y, state->layer_text, state->font_dejavusansbold12, Black); | ||
417 | gdispFlush(); | ||
418 | return false; | ||
419 | } | ||
420 | |||
399 | #endif // LCD_ENABLE | 421 | #endif // LCD_ENABLE |
400 | 422 | ||
401 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { | 423 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { |