summaryrefslogtreecommitdiff
path: root/keyboards/ergodox/infinity/visualizer.c
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-04-08 22:48:18 +0300
committerFred Sundvik <fsundvik@gmail.com>2017-04-09 18:34:59 +0300
commit306353bf06e5e5a76890ffb0c48a4dcca76c4399 (patch)
treed2563b3523b5ca189c86a3bd675d165481933902 /keyboards/ergodox/infinity/visualizer.c
parentc6ca996f4eaa4cce90e02c123230e1e655c9465a (diff)
Create a file for shared Ergodox Infinity animations
Diffstat (limited to 'keyboards/ergodox/infinity/visualizer.c')
-rw-r--r--keyboards/ergodox/infinity/visualizer.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c
index 7ae371c5fc..a4b09a34d0 100644
--- a/keyboards/ergodox/infinity/visualizer.c
+++ b/keyboards/ergodox/infinity/visualizer.c
@@ -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 "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,19 +73,6 @@ _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 = 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,
- },
-};
// The color animation animates the LCD color when you change layers
static keyframe_animation_t one_led_color = {
@@ -127,18 +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,
- backlight_keyframe_disable,
- },
-};
-
void initialize_user_visualizer(visualizer_state_t* state) {
// The brightness will be dynamically adjustable in the future
// But for now, change it here.
@@ -146,13 +120,9 @@ 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) {
return user_data->led_on & (1u << num);
}
@@ -295,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(&startup_animation);
+ start_keyframe_animation(&default_startup_animation);
}
void ergodox_board_led_on(void){