]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/ergodox/infinity/visualizer.c
Delete ALPS RIGHT B.dxf
[qmk_firmware.git] / keyboards / ergodox / infinity / visualizer.c
index bac85c593cf8ea1be4a5aa3de0de82b464843975..4b16021abcd9da4a013452d23a8579fc25c0f767 100644 (file)
@@ -31,8 +31,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "lcd_keyframes.h"
 #include "lcd_backlight_keyframes.h"
 #include "system/serial_link.h"
-
-#include "resources/resources.h"
+#include "default_animations.h"
 
 static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
 static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
@@ -74,24 +73,13 @@ _Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
 
 // Feel free to modify the animations below, or even add new ones if needed
 
-// Don't worry, if the startup animation is long, you can use the keyboard like normal
-// during that time
-static keyframe_animation_t startup_animation = {
-    .num_frames = 2,
-    .loop = false,
-    .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0},
-    .frame_functions = {
-            lcd_keyframe_draw_logo,
-            backlight_keyframe_animate_color,
-    },
-};
 
 // The color animation animates the LCD color when you change layers
 static keyframe_animation_t one_led_color = {
     .num_frames = 1,
     .loop = false,
     .frame_lengths = {gfxMillisecondsToTicks(0)},
-    .frame_functions = {backlight_keyframe_set_color},
+    .frame_functions = {lcd_backlight_keyframe_set_color},
 };
 
 bool swap_led_target_color(keyframe_animation_t* animation, visualizer_state_t* state) {
@@ -106,7 +94,7 @@ static keyframe_animation_t two_led_colors = {
     .num_frames = 2,
     .loop = true,
     .frame_lengths = {gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(0)},
-    .frame_functions = {backlight_keyframe_set_color, swap_led_target_color},
+    .frame_functions = {lcd_backlight_keyframe_set_color, swap_led_target_color},
 };
 
 // The LCD animation alternates between the layer name display and a
@@ -125,30 +113,6 @@ static keyframe_animation_t lcd_bitmap_leds_animation = {
     .frame_functions = {lcd_keyframe_display_layer_bitmap, lcd_keyframe_display_led_states},
 };
 
-static keyframe_animation_t suspend_animation = {
-    .num_frames = 4,
-    .loop = false,
-    .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0},
-    .frame_functions = {
-            lcd_keyframe_display_layer_text,
-            backlight_keyframe_animate_color,
-            lcd_keyframe_disable,
-            lcd_keyframe_disable,
-    },
-};
-
-static keyframe_animation_t resume_animation = {
-    .num_frames = 4,
-    .loop = false,
-    .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(10000), 0},
-    .frame_functions = {
-            lcd_keyframe_enable,
-            backlight_keyframe_enable,
-            lcd_keyframe_draw_logo,
-            backlight_keyframe_animate_color,
-    },
-};
-
 void initialize_user_visualizer(visualizer_state_t* state) {
     // The brightness will be dynamically adjustable in the future
     // But for now, change it here.
@@ -156,14 +120,10 @@ void initialize_user_visualizer(visualizer_state_t* state) {
     state->current_lcd_color = initial_color;
     state->target_lcd_color = logo_background_color;
     lcd_state = LCD_STATE_INITIAL;
-    start_keyframe_animation(&startup_animation);
+    start_keyframe_animation(&default_startup_animation);
 }
 
-static const uint32_t red;
-static const uint32_t green;
-static const uint32_t blue;
-
-inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) {
+static inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) {
     return user_data->led_on & (1u << num);
 }
 
@@ -305,14 +265,14 @@ void user_visualizer_suspend(visualizer_state_t* state) {
     uint8_t hue = LCD_HUE(state->current_lcd_color);
     uint8_t sat = LCD_SAT(state->current_lcd_color);
     state->target_lcd_color = LCD_COLOR(hue, sat, 0);
-    start_keyframe_animation(&suspend_animation);
+    start_keyframe_animation(&default_suspend_animation);
 }
 
 void user_visualizer_resume(visualizer_state_t* state) {
     state->current_lcd_color = initial_color;
     state->target_lcd_color = logo_background_color;
     lcd_state = LCD_STATE_INITIAL;
-    start_keyframe_animation(&resume_animation);
+    start_keyframe_animation(&default_startup_animation);
 }
 
 void ergodox_board_led_on(void){