diff options
author | skullY <skullydazed@gmail.com> | 2019-08-30 11:19:03 -0700 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-08-30 15:01:52 -0700 |
commit | b624f32f944acdc59dcb130674c09090c5c404cb (patch) | |
tree | bc13adbba137d122d9a2c2fb2fafcbb08ac10e25 /quantum/visualizer/default_animations.c | |
parent | 61af76a10d00aba185b8338604171de490a13e3b (diff) | |
download | qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.tar.gz qmk_firmware-b624f32f944acdc59dcb130674c09090c5c404cb.zip |
clang-format changes
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 2d0327372..2f43c67cc 100644 --- a/quantum/visualizer/default_animations.c +++ b/quantum/visualizer/default_animations.c | |||
@@ -16,161 +16,162 @@ | |||
16 | 16 | ||
17 | #if defined(VISUALIZER_ENABLE) | 17 | #if defined(VISUALIZER_ENABLE) |
18 | 18 | ||
19 | #include "default_animations.h" | 19 | # include "default_animations.h" |
20 | #include "visualizer.h" | 20 | # include "visualizer.h" |
21 | #ifdef LCD_ENABLE | 21 | # ifdef LCD_ENABLE |
22 | #include "lcd_keyframes.h" | 22 | # include "lcd_keyframes.h" |
23 | #endif | 23 | # endif |
24 | #ifdef LCD_BACKLIGHT_ENABLE | 24 | # ifdef LCD_BACKLIGHT_ENABLE |
25 | #include "lcd_backlight_keyframes.h" | 25 | # include "lcd_backlight_keyframes.h" |
26 | #endif | 26 | # endif |
27 | |||
28 | #ifdef BACKLIGHT_ENABLE | ||
29 | #include "led_backlight_keyframes.h" | ||
30 | #endif | ||
31 | 27 | ||
32 | #include "visualizer_keyframes.h" | 28 | # ifdef BACKLIGHT_ENABLE |
29 | # include "led_backlight_keyframes.h" | ||
30 | # endif | ||
33 | 31 | ||
32 | # include "visualizer_keyframes.h" | ||
34 | 33 | ||
35 | #if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE) | 34 | # if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE) |
36 | 35 | ||
37 | static bool keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { | 36 | static bool keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { |
38 | #ifdef LCD_ENABLE | 37 | # ifdef LCD_ENABLE |
39 | lcd_keyframe_enable(animation, state); | 38 | lcd_keyframe_enable(animation, state); |
40 | #endif | 39 | # endif |
41 | #ifdef LCD_BACKLIGHT_ENABLE | 40 | # ifdef LCD_BACKLIGHT_ENABLE |
42 | lcd_backlight_keyframe_enable(animation, state); | 41 | lcd_backlight_keyframe_enable(animation, state); |
43 | #endif | 42 | # endif |
44 | #ifdef BACKLIGHT_ENABLE | 43 | # ifdef BACKLIGHT_ENABLE |
45 | led_backlight_keyframe_enable(animation, state); | 44 | led_backlight_keyframe_enable(animation, state); |
46 | #endif | 45 | # endif |
47 | return false; | 46 | return false; |
48 | } | 47 | } |
49 | 48 | ||
50 | static bool keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { | 49 | static bool keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { |
51 | #ifdef LCD_ENABLE | 50 | # ifdef LCD_ENABLE |
52 | lcd_keyframe_disable(animation, state); | 51 | lcd_keyframe_disable(animation, state); |
53 | #endif | 52 | # endif |
54 | #ifdef LCD_BACKLIGHT_ENABLE | 53 | # ifdef LCD_BACKLIGHT_ENABLE |
55 | lcd_backlight_keyframe_disable(animation, state); | 54 | lcd_backlight_keyframe_disable(animation, state); |
56 | #endif | 55 | # endif |
57 | #ifdef BACKLIGHT_ENABLE | 56 | # ifdef BACKLIGHT_ENABLE |
58 | led_backlight_keyframe_disable(animation, state); | 57 | led_backlight_keyframe_disable(animation, state); |
59 | #endif | 58 | # endif |
60 | return false; | 59 | return false; |
61 | } | 60 | } |
62 | 61 | ||
63 | static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t* state) { | 62 | static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t* state) { |
64 | bool ret = false; | 63 | bool ret = false; |
65 | #ifdef LCD_BACKLIGHT_ENABLE | 64 | # ifdef LCD_BACKLIGHT_ENABLE |
66 | ret |= lcd_backlight_keyframe_animate_color(animation, state); | 65 | ret |= lcd_backlight_keyframe_animate_color(animation, state); |
67 | #endif | 66 | # endif |
68 | #ifdef BACKLIGHT_ENABLE | 67 | # ifdef BACKLIGHT_ENABLE |
69 | ret |= led_backlight_keyframe_fade_in_all(animation, state); | 68 | ret |= led_backlight_keyframe_fade_in_all(animation, state); |
70 | #endif | 69 | # endif |
71 | return ret; | 70 | return ret; |
72 | } | 71 | } |
73 | 72 | ||
74 | static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_t* state) { | 73 | static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_t* state) { |
75 | bool ret = false; | 74 | bool ret = false; |
76 | #ifdef LCD_BACKLIGHT_ENABLE | 75 | # ifdef LCD_BACKLIGHT_ENABLE |
77 | ret |= lcd_backlight_keyframe_animate_color(animation, state); | 76 | ret |= lcd_backlight_keyframe_animate_color(animation, state); |
78 | #endif | 77 | # endif |
79 | #ifdef BACKLIGHT_ENABLE | 78 | # ifdef BACKLIGHT_ENABLE |
80 | ret |= led_backlight_keyframe_fade_out_all(animation, state); | 79 | ret |= led_backlight_keyframe_fade_out_all(animation, state); |
81 | #endif | 80 | # endif |
82 | return ret; | 81 | return ret; |
83 | } | 82 | } |
84 | 83 | ||
85 | |||
86 | // Don't worry, if the startup animation is long, you can use the keyboard like normal | 84 | // Don't worry, if the startup animation is long, you can use the keyboard like normal |
87 | // during that time | 85 | // during that time |
88 | keyframe_animation_t default_startup_animation = { | 86 | keyframe_animation_t default_startup_animation = { |
89 | #if LCD_ENABLE | 87 | # if LCD_ENABLE |
90 | .num_frames = 3, | 88 | .num_frames = 3, |
91 | #else | 89 | # else |
92 | .num_frames = 2, | 90 | .num_frames = 2, |
93 | #endif | 91 | # endif |
94 | .loop = false, | 92 | .loop = false, |
95 | .frame_lengths = { | 93 | .frame_lengths = {0, |
96 | 0, | 94 | # if LCD_ENABLE |
97 | #if LCD_ENABLE | 95 | 0, |
98 | 0, | 96 | # endif |
99 | #endif | 97 | gfxMillisecondsToTicks(5000)}, |
100 | gfxMillisecondsToTicks(5000)}, | 98 | .frame_functions = |
101 | .frame_functions = { | 99 | { |
102 | keyframe_enable, | 100 | keyframe_enable, |
103 | #if LCD_ENABLE | 101 | # if LCD_ENABLE |
104 | lcd_keyframe_draw_logo, | 102 | lcd_keyframe_draw_logo, |
105 | #endif | 103 | # endif |
106 | keyframe_fade_in, | 104 | keyframe_fade_in, |
107 | }, | 105 | }, |
108 | }; | 106 | }; |
109 | 107 | ||
110 | keyframe_animation_t default_suspend_animation = { | 108 | keyframe_animation_t default_suspend_animation = { |
111 | #if LCD_ENABLE | 109 | # if LCD_ENABLE |
112 | .num_frames = 3, | 110 | .num_frames = 3, |
113 | #else | 111 | # else |
114 | .num_frames = 2, | 112 | .num_frames = 2, |
115 | #endif | 113 | # endif |
116 | .loop = false, | 114 | .loop = false, |
117 | .frame_lengths = { | 115 | .frame_lengths = |
118 | #if LCD_ENABLE | 116 | { |
119 | 0, | 117 | # if LCD_ENABLE |
120 | #endif | 118 | 0, |
121 | gfxMillisecondsToTicks(1000), | 119 | # endif |
122 | 0}, | 120 | gfxMillisecondsToTicks(1000), 0}, |
123 | .frame_functions = { | 121 | .frame_functions = |
124 | #if LCD_ENABLE | 122 | { |
123 | # if LCD_ENABLE | ||
125 | lcd_keyframe_display_layer_text, | 124 | lcd_keyframe_display_layer_text, |
126 | #endif | 125 | # endif |
127 | keyframe_fade_out, | 126 | keyframe_fade_out, |
128 | keyframe_disable, | 127 | keyframe_disable, |
129 | }, | 128 | }, |
130 | }; | 129 | }; |
131 | #endif | 130 | # endif |
132 | 131 | ||
133 | #if defined(BACKLIGHT_ENABLE) | 132 | # if defined(BACKLIGHT_ENABLE) |
134 | #define CROSSFADE_TIME 1000 | 133 | # define CROSSFADE_TIME 1000 |
135 | #define GRADIENT_TIME 3000 | 134 | # define GRADIENT_TIME 3000 |
136 | 135 | ||
137 | keyframe_animation_t led_test_animation = { | 136 | keyframe_animation_t led_test_animation = { |
138 | .num_frames = 14, | 137 | .num_frames = 14, |
139 | .loop = true, | 138 | .loop = true, |
140 | .frame_lengths = { | 139 | .frame_lengths = |
141 | gfxMillisecondsToTicks(1000), // fade in | 140 | { |
142 | gfxMillisecondsToTicks(1000), // no op (leds on) | 141 | gfxMillisecondsToTicks(1000), // fade in |
143 | gfxMillisecondsToTicks(1000), // fade out | 142 | gfxMillisecondsToTicks(1000), // no op (leds on) |
144 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade | 143 | gfxMillisecondsToTicks(1000), // fade out |
145 | gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in) | 144 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade |
146 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade | 145 | gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in) |
147 | gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom | 146 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade |
148 | 0, // mirror leds | 147 | gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom |
149 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade | 148 | 0, // mirror leds |
150 | gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out) | 149 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade |
151 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade | 150 | gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out) |
152 | gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom | 151 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade |
153 | 0, // normal leds | 152 | gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom |
154 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade | 153 | 0, // normal leds |
155 | 154 | gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade | |
156 | }, | 155 | |
157 | .frame_functions = { | 156 | }, |
158 | led_backlight_keyframe_fade_in_all, | 157 | .frame_functions = |
159 | keyframe_no_operation, | 158 | { |
160 | led_backlight_keyframe_fade_out_all, | 159 | led_backlight_keyframe_fade_in_all, |
161 | led_backlight_keyframe_crossfade, | 160 | keyframe_no_operation, |
162 | led_backlight_keyframe_left_to_right_gradient, | 161 | led_backlight_keyframe_fade_out_all, |
163 | led_backlight_keyframe_crossfade, | 162 | led_backlight_keyframe_crossfade, |
164 | led_backlight_keyframe_top_to_bottom_gradient, | 163 | led_backlight_keyframe_left_to_right_gradient, |
165 | led_backlight_keyframe_mirror_orientation, | 164 | led_backlight_keyframe_crossfade, |
166 | led_backlight_keyframe_crossfade, | 165 | led_backlight_keyframe_top_to_bottom_gradient, |
167 | led_backlight_keyframe_left_to_right_gradient, | 166 | led_backlight_keyframe_mirror_orientation, |
168 | led_backlight_keyframe_crossfade, | 167 | led_backlight_keyframe_crossfade, |
169 | led_backlight_keyframe_top_to_bottom_gradient, | 168 | led_backlight_keyframe_left_to_right_gradient, |
170 | led_backlight_keyframe_normal_orientation, | 169 | led_backlight_keyframe_crossfade, |
171 | led_backlight_keyframe_crossfade, | 170 | led_backlight_keyframe_top_to_bottom_gradient, |
172 | }, | 171 | led_backlight_keyframe_normal_orientation, |
172 | led_backlight_keyframe_crossfade, | ||
173 | }, | ||
173 | }; | 174 | }; |
174 | #endif | 175 | # endif |
175 | 176 | ||
176 | #endif | 177 | #endif |