diff options
Diffstat (limited to 'keyboards/ergodox/infinity/visualizer.c')
| -rw-r--r-- | keyboards/ergodox/infinity/visualizer.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c index 7ae371c5f..a4b09a34d 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/>. | |||
| 31 | #include "lcd_keyframes.h" | 31 | #include "lcd_keyframes.h" |
| 32 | #include "lcd_backlight_keyframes.h" | 32 | #include "lcd_backlight_keyframes.h" |
| 33 | #include "system/serial_link.h" | 33 | #include "system/serial_link.h" |
| 34 | 34 | #include "animations.h" | |
| 35 | #include "resources/resources.h" | ||
| 36 | 35 | ||
| 37 | static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF); | 36 | static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF); |
| 38 | static const uint32_t initial_color = LCD_COLOR(0, 0, 0); | 37 | 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, | |||
| 74 | 73 | ||
| 75 | // Feel free to modify the animations below, or even add new ones if needed | 74 | // Feel free to modify the animations below, or even add new ones if needed |
| 76 | 75 | ||
| 77 | // Don't worry, if the startup animation is long, you can use the keyboard like normal | ||
| 78 | // during that time | ||
| 79 | static keyframe_animation_t startup_animation = { | ||
| 80 | .num_frames = 4, | ||
| 81 | .loop = false, | ||
| 82 | .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(10000), 0}, | ||
| 83 | .frame_functions = { | ||
| 84 | lcd_keyframe_enable, | ||
| 85 | backlight_keyframe_enable, | ||
| 86 | lcd_keyframe_draw_logo, | ||
| 87 | backlight_keyframe_animate_color, | ||
| 88 | }, | ||
| 89 | }; | ||
| 90 | 76 | ||
| 91 | // The color animation animates the LCD color when you change layers | 77 | // The color animation animates the LCD color when you change layers |
| 92 | static keyframe_animation_t one_led_color = { | 78 | static keyframe_animation_t one_led_color = { |
| @@ -127,18 +113,6 @@ static keyframe_animation_t lcd_bitmap_leds_animation = { | |||
| 127 | .frame_functions = {lcd_keyframe_display_layer_bitmap, lcd_keyframe_display_led_states}, | 113 | .frame_functions = {lcd_keyframe_display_layer_bitmap, lcd_keyframe_display_led_states}, |
| 128 | }; | 114 | }; |
| 129 | 115 | ||
| 130 | static keyframe_animation_t suspend_animation = { | ||
| 131 | .num_frames = 4, | ||
| 132 | .loop = false, | ||
| 133 | .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0}, | ||
| 134 | .frame_functions = { | ||
| 135 | lcd_keyframe_display_layer_text, | ||
| 136 | backlight_keyframe_animate_color, | ||
| 137 | lcd_keyframe_disable, | ||
| 138 | backlight_keyframe_disable, | ||
| 139 | }, | ||
| 140 | }; | ||
| 141 | |||
| 142 | void initialize_user_visualizer(visualizer_state_t* state) { | 116 | void initialize_user_visualizer(visualizer_state_t* state) { |
| 143 | // The brightness will be dynamically adjustable in the future | 117 | // The brightness will be dynamically adjustable in the future |
| 144 | // But for now, change it here. | 118 | // But for now, change it here. |
| @@ -146,13 +120,9 @@ void initialize_user_visualizer(visualizer_state_t* state) { | |||
| 146 | state->current_lcd_color = initial_color; | 120 | state->current_lcd_color = initial_color; |
| 147 | state->target_lcd_color = logo_background_color; | 121 | state->target_lcd_color = logo_background_color; |
| 148 | lcd_state = LCD_STATE_INITIAL; | 122 | lcd_state = LCD_STATE_INITIAL; |
| 149 | start_keyframe_animation(&startup_animation); | 123 | start_keyframe_animation(&default_startup_animation); |
| 150 | } | 124 | } |
| 151 | 125 | ||
| 152 | static const uint32_t red; | ||
| 153 | static const uint32_t green; | ||
| 154 | static const uint32_t blue; | ||
| 155 | |||
| 156 | inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) { | 126 | inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) { |
| 157 | return user_data->led_on & (1u << num); | 127 | return user_data->led_on & (1u << num); |
| 158 | } | 128 | } |
| @@ -295,14 +265,14 @@ void user_visualizer_suspend(visualizer_state_t* state) { | |||
| 295 | uint8_t hue = LCD_HUE(state->current_lcd_color); | 265 | uint8_t hue = LCD_HUE(state->current_lcd_color); |
| 296 | uint8_t sat = LCD_SAT(state->current_lcd_color); | 266 | uint8_t sat = LCD_SAT(state->current_lcd_color); |
| 297 | state->target_lcd_color = LCD_COLOR(hue, sat, 0); | 267 | state->target_lcd_color = LCD_COLOR(hue, sat, 0); |
| 298 | start_keyframe_animation(&suspend_animation); | 268 | start_keyframe_animation(&default_suspend_animation); |
| 299 | } | 269 | } |
| 300 | 270 | ||
| 301 | void user_visualizer_resume(visualizer_state_t* state) { | 271 | void user_visualizer_resume(visualizer_state_t* state) { |
| 302 | state->current_lcd_color = initial_color; | 272 | state->current_lcd_color = initial_color; |
| 303 | state->target_lcd_color = logo_background_color; | 273 | state->target_lcd_color = logo_background_color; |
| 304 | lcd_state = LCD_STATE_INITIAL; | 274 | lcd_state = LCD_STATE_INITIAL; |
| 305 | start_keyframe_animation(&startup_animation); | 275 | start_keyframe_animation(&default_startup_animation); |
| 306 | } | 276 | } |
| 307 | 277 | ||
| 308 | void ergodox_board_led_on(void){ | 278 | void ergodox_board_led_on(void){ |
