]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/ergodox/infinity/animations.c
Rename led test to led_keyframes and move animation to Ergodox
[qmk_firmware.git] / keyboards / ergodox / infinity / animations.c
1 /* Copyright 2017 Fred Sundvik
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15  */
16
17 #if defined(VISUALIZER_ENABLE)
18
19 #include "animations.h"
20 #include "visualizer.h"
21 #ifdef LCD_ENABLE
22 #include "lcd_keyframes.h"
23 #endif
24 #ifdef LCD_BACKLIGHT_ENABLE
25 #include "lcd_backlight_keyframes.h"
26 #endif
27
28 #ifdef LED_ENABLE
29 #include "led_keyframes.h"
30 #endif
31
32 #include "visualizer_keyframes.h"
33
34
35 #if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE)
36
37 // Don't worry, if the startup animation is long, you can use the keyboard like normal
38 // during that time
39 keyframe_animation_t default_startup_animation = {
40     .num_frames = 4,
41     .loop = false,
42     .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0},
43     .frame_functions = {
44             lcd_keyframe_enable,
45             backlight_keyframe_enable,
46             lcd_keyframe_draw_logo,
47             backlight_keyframe_animate_color,
48     },
49 };
50
51 keyframe_animation_t default_suspend_animation = {
52     .num_frames = 4,
53     .loop = false,
54     .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0},
55     .frame_functions = {
56             lcd_keyframe_display_layer_text,
57             backlight_keyframe_animate_color,
58             lcd_keyframe_disable,
59             backlight_keyframe_disable,
60     },
61 };
62 #endif
63
64 #if defined(LED_ENABLE)
65 #define CROSSFADE_TIME 1000
66 #define GRADIENT_TIME 3000
67
68 keyframe_animation_t led_test_animation = {
69     .num_frames = 14,
70     .loop = true,
71     .frame_lengths = {
72         gfxMillisecondsToTicks(1000), // fade in
73         gfxMillisecondsToTicks(1000), // no op (leds on)
74         gfxMillisecondsToTicks(1000), // fade out
75         gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
76         gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in)
77         gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
78         gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
79         0,           // mirror leds
80         gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
81         gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out)
82         gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
83         gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
84         0,           // normal leds
85         gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
86
87     },
88     .frame_functions = {
89         led_keyframe_fade_in_all,
90         keyframe_no_operation,
91         led_keyframe_fade_out_all,
92         led_keyframe_crossfade,
93         led_keyframe_left_to_right_gradient,
94         led_keyframe_crossfade,
95         led_keyframe_top_to_bottom_gradient,
96         led_keyframe_mirror_orientation,
97         led_keyframe_crossfade,
98         led_keyframe_left_to_right_gradient,
99         led_keyframe_crossfade,
100         led_keyframe_top_to_bottom_gradient,
101         led_keyframe_normal_orientation,
102         led_keyframe_crossfade,
103     },
104 };
105 #endif
106
107 #endif