diff options
author | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
---|---|---|
committer | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
commit | e7f4d56592b3975c38af329e77b4efd9108495e8 (patch) | |
tree | 0a416bccbf70bfdbdb9ffcdb3bf136b47378c014 /quantum/visualizer/default_animations.c | |
parent | 71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (diff) | |
parent | 8416a94ad27b3ff058576f09f35f0704a8b39ff3 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'quantum/visualizer/default_animations.c')
-rw-r--r-- | quantum/visualizer/default_animations.c | 203 |
1 files changed, 102 insertions, 101 deletions
diff --git a/quantum/visualizer/default_animations.c b/quantum/visualizer/default_animations.c index 2d03273720..2f43c67cc8 100644 --- a/quantum/visualizer/default_animations.c +++ b/quantum/visualizer/default_animations.c @@ -16,161 +16,162 @@ #if defined(VISUALIZER_ENABLE) -#include "default_animations.h" -#include "visualizer.h" -#ifdef LCD_ENABLE -#include "lcd_keyframes.h" -#endif -#ifdef LCD_BACKLIGHT_ENABLE -#include "lcd_backlight_keyframes.h" -#endif - -#ifdef BACKLIGHT_ENABLE -#include "led_backlight_keyframes.h" -#endif +# include "default_animations.h" +# include "visualizer.h" +# ifdef LCD_ENABLE +# include "lcd_keyframes.h" +# endif +# ifdef LCD_BACKLIGHT_ENABLE +# include "lcd_backlight_keyframes.h" +# endif -#include "visualizer_keyframes.h" +# ifdef BACKLIGHT_ENABLE +# include "led_backlight_keyframes.h" +# endif +# include "visualizer_keyframes.h" -#if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE) +# if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE) static bool keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { -#ifdef LCD_ENABLE +# ifdef LCD_ENABLE lcd_keyframe_enable(animation, state); -#endif -#ifdef LCD_BACKLIGHT_ENABLE +# endif +# ifdef LCD_BACKLIGHT_ENABLE lcd_backlight_keyframe_enable(animation, state); -#endif -#ifdef BACKLIGHT_ENABLE +# endif +# ifdef BACKLIGHT_ENABLE led_backlight_keyframe_enable(animation, state); -#endif +# endif return false; } static bool keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { -#ifdef LCD_ENABLE +# ifdef LCD_ENABLE lcd_keyframe_disable(animation, state); -#endif -#ifdef LCD_BACKLIGHT_ENABLE +# endif +# ifdef LCD_BACKLIGHT_ENABLE lcd_backlight_keyframe_disable(animation, state); -#endif -#ifdef BACKLIGHT_ENABLE +# endif +# ifdef BACKLIGHT_ENABLE led_backlight_keyframe_disable(animation, state); -#endif +# endif return false; } static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t* state) { bool ret = false; -#ifdef LCD_BACKLIGHT_ENABLE +# ifdef LCD_BACKLIGHT_ENABLE ret |= lcd_backlight_keyframe_animate_color(animation, state); -#endif -#ifdef BACKLIGHT_ENABLE +# endif +# ifdef BACKLIGHT_ENABLE ret |= led_backlight_keyframe_fade_in_all(animation, state); -#endif +# endif return ret; } static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_t* state) { bool ret = false; -#ifdef LCD_BACKLIGHT_ENABLE +# ifdef LCD_BACKLIGHT_ENABLE ret |= lcd_backlight_keyframe_animate_color(animation, state); -#endif -#ifdef BACKLIGHT_ENABLE +# endif +# ifdef BACKLIGHT_ENABLE ret |= led_backlight_keyframe_fade_out_all(animation, state); -#endif +# endif return ret; } - // Don't worry, if the startup animation is long, you can use the keyboard like normal // during that time keyframe_animation_t default_startup_animation = { -#if LCD_ENABLE +# if LCD_ENABLE .num_frames = 3, -#else +# else .num_frames = 2, -#endif - .loop = false, - .frame_lengths = { - 0, -#if LCD_ENABLE - 0, -#endif - gfxMillisecondsToTicks(5000)}, - .frame_functions = { +# endif + .loop = false, + .frame_lengths = {0, +# if LCD_ENABLE + 0, +# endif + gfxMillisecondsToTicks(5000)}, + .frame_functions = + { keyframe_enable, -#if LCD_ENABLE +# if LCD_ENABLE lcd_keyframe_draw_logo, -#endif +# endif keyframe_fade_in, - }, + }, }; keyframe_animation_t default_suspend_animation = { -#if LCD_ENABLE +# if LCD_ENABLE .num_frames = 3, -#else +# else .num_frames = 2, -#endif +# endif .loop = false, - .frame_lengths = { -#if LCD_ENABLE - 0, -#endif - gfxMillisecondsToTicks(1000), - 0}, - .frame_functions = { -#if LCD_ENABLE + .frame_lengths = + { +# if LCD_ENABLE + 0, +# endif + gfxMillisecondsToTicks(1000), 0}, + .frame_functions = + { +# if LCD_ENABLE lcd_keyframe_display_layer_text, -#endif +# endif keyframe_fade_out, keyframe_disable, - }, + }, }; -#endif +# endif -#if defined(BACKLIGHT_ENABLE) -#define CROSSFADE_TIME 1000 -#define GRADIENT_TIME 3000 +# if defined(BACKLIGHT_ENABLE) +# define CROSSFADE_TIME 1000 +# define GRADIENT_TIME 3000 keyframe_animation_t led_test_animation = { .num_frames = 14, - .loop = true, - .frame_lengths = { - gfxMillisecondsToTicks(1000), // fade in - gfxMillisecondsToTicks(1000), // no op (leds on) - gfxMillisecondsToTicks(1000), // fade out - gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade - gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in) - gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade - gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom - 0, // mirror leds - gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade - gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out) - gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade - gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom - 0, // normal leds - gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade - - }, - .frame_functions = { - led_backlight_keyframe_fade_in_all, - keyframe_no_operation, - led_backlight_keyframe_fade_out_all, - led_backlight_keyframe_crossfade, - led_backlight_keyframe_left_to_right_gradient, - led_backlight_keyframe_crossfade, - led_backlight_keyframe_top_to_bottom_gradient, - led_backlight_keyframe_mirror_orientation, - led_backlight_keyframe_crossfade, - led_backlight_keyframe_left_to_right_gradient, - led_backlight_keyframe_crossfade, - led_backlight_keyframe_top_to_bottom_gradient, - led_backlight_keyframe_normal_orientation, - led_backlight_keyframe_crossfade, - }, + .loop = true, + .frame_lengths = + { + gfxMillisecondsToTicks(1000), // fade in + gfxMillisecondsToTicks(1000), // no op (leds on) + gfxMillisecondsToTicks(1000), // fade out + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in) + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom + 0, // mirror leds + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out) + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom + 0, // normal leds + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + + }, + .frame_functions = + { + led_backlight_keyframe_fade_in_all, + keyframe_no_operation, + led_backlight_keyframe_fade_out_all, + led_backlight_keyframe_crossfade, + led_backlight_keyframe_left_to_right_gradient, + led_backlight_keyframe_crossfade, + led_backlight_keyframe_top_to_bottom_gradient, + led_backlight_keyframe_mirror_orientation, + led_backlight_keyframe_crossfade, + led_backlight_keyframe_left_to_right_gradient, + led_backlight_keyframe_crossfade, + led_backlight_keyframe_top_to_bottom_gradient, + led_backlight_keyframe_normal_orientation, + led_backlight_keyframe_crossfade, + }, }; -#endif +# endif #endif |