aboutsummaryrefslogtreecommitdiff
path: root/keyboards/ergodox/infinity/animations.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ergodox/infinity/animations.c')
-rw-r--r--keyboards/ergodox/infinity/animations.c69
1 files changed, 58 insertions, 11 deletions
diff --git a/keyboards/ergodox/infinity/animations.c b/keyboards/ergodox/infinity/animations.c
index 0e732b741..675519e30 100644
--- a/keyboards/ergodox/infinity/animations.c
+++ b/keyboards/ergodox/infinity/animations.c
@@ -32,31 +32,78 @@
32#include "visualizer_keyframes.h" 32#include "visualizer_keyframes.h"
33 33
34 34
35#if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE) 35#if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE)
36
37static bool keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
38#ifdef LCD_ENABLE
39 lcd_keyframe_enable(animation, state);
40#endif
41#ifdef LCD_BACKLIGHT_ENABLE
42 backlight_keyframe_enable(animation, state);
43#endif
44#ifdef BACKLIGHT_ENABLE
45 led_keyframe_enable(animation, state);
46#endif
47 return false;
48}
49
50static bool keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
51#ifdef LCD_ENABLE
52 lcd_keyframe_disable(animation, state);
53#endif
54#ifdef LCD_BACKLIGHT_ENABLE
55 backlight_keyframe_disable(animation, state);
56#endif
57#ifdef BACKLIGHT_ENABLE
58 led_keyframe_disable(animation, state);
59#endif
60 return false;
61}
62
63static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t* state) {
64 bool ret = false;
65#ifdef LCD_BACKLIGHT_ENABLE
66 ret |= backlight_keyframe_animate_color(animation, state);
67#endif
68#ifdef BACLIGHT_ENABLE
69 ret |= led_keyframe_fade_in_all(animation, state);
70#endif
71 return ret;
72}
73
74static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_t* state) {
75 bool ret = false;
76#ifdef LCD_BACKLIGHT_ENABLE
77 ret |= backlight_keyframe_animate_color(animation, state);
78#endif
79#ifdef BACLIGHT_ENABLE
80 ret |= led_keyframe_fade_out_all(animation, state);
81#endif
82 return ret;
83}
84
36 85
37// Don't worry, if the startup animation is long, you can use the keyboard like normal 86// Don't worry, if the startup animation is long, you can use the keyboard like normal
38// during that time 87// during that time
39keyframe_animation_t default_startup_animation = { 88keyframe_animation_t default_startup_animation = {
40 .num_frames = 4, 89 .num_frames = 3,
41 .loop = false, 90 .loop = false,
42 .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0}, 91 .frame_lengths = {0, 0, gfxMillisecondsToTicks(5000)},
43 .frame_functions = { 92 .frame_functions = {
44 lcd_keyframe_enable, 93 keyframe_enable,
45 backlight_keyframe_enable,
46 lcd_keyframe_draw_logo, 94 lcd_keyframe_draw_logo,
47 backlight_keyframe_animate_color, 95 keyframe_fade_in,
48 }, 96 },
49}; 97};
50 98
51keyframe_animation_t default_suspend_animation = { 99keyframe_animation_t default_suspend_animation = {
52 .num_frames = 4, 100 .num_frames = 3,
53 .loop = false, 101 .loop = false,
54 .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0}, 102 .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0},
55 .frame_functions = { 103 .frame_functions = {
56 lcd_keyframe_display_layer_text, 104 lcd_keyframe_display_layer_text,
57 backlight_keyframe_animate_color, 105 keyframe_fade_out,
58 lcd_keyframe_disable, 106 keyframe_disable,
59 backlight_keyframe_disable,
60 }, 107 },
61}; 108};
62#endif 109#endif