]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/ergodox/infinity/animations.c
Rename led test to led_keyframes and move animation to Ergodox
[qmk_firmware.git] / keyboards / ergodox / infinity / animations.c
index 54ab994607c14afb7871d48a1298cc30accb875b..4c9f6d9c85a65f8b6308f756fbd413b2552518a6 100644 (file)
@@ -14,6 +14,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#if defined(VISUALIZER_ENABLE)
+
 #include "animations.h"
 #include "visualizer.h"
 #ifdef LCD_ENABLE
 #include "lcd_backlight_keyframes.h"
 #endif
 
-#if defined(VISUALIZER_ENABLE) && defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE)
+#ifdef LED_ENABLE
+#include "led_keyframes.h"
+#endif
+
+#include "visualizer_keyframes.h"
+
+
+#if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE)
 
 // Don't worry, if the startup animation is long, you can use the keyboard like normal
 // during that time
@@ -50,5 +59,49 @@ keyframe_animation_t default_suspend_animation = {
             backlight_keyframe_disable,
     },
 };
+#endif
+
+#if defined(LED_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_keyframe_fade_in_all,
+        keyframe_no_operation,
+        led_keyframe_fade_out_all,
+        led_keyframe_crossfade,
+        led_keyframe_left_to_right_gradient,
+        led_keyframe_crossfade,
+        led_keyframe_top_to_bottom_gradient,
+        led_keyframe_mirror_orientation,
+        led_keyframe_crossfade,
+        led_keyframe_left_to_right_gradient,
+        led_keyframe_crossfade,
+        led_keyframe_top_to_bottom_gradient,
+        led_keyframe_normal_orientation,
+        led_keyframe_crossfade,
+    },
+};
+#endif
 
 #endif