aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ergodox/infinity/visualizer.c22
-rw-r--r--keyboards/ergodox/keymaps/default/visualizer.c22
-rw-r--r--quantum/visualizer/lcd_keyframes.c19
-rw-r--r--quantum/visualizer/lcd_keyframes.h2
4 files changed, 25 insertions, 40 deletions
diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c
index 90933b00a..bac85c593 100644
--- a/keyboards/ergodox/infinity/visualizer.c
+++ b/keyboards/ergodox/infinity/visualizer.c
@@ -72,24 +72,6 @@ static visualizer_user_data_t user_data_keyboard = {
72_Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE, 72_Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
73 "Please increase the VISUALIZER_USER_DATA_SIZE"); 73 "Please increase the VISUALIZER_USER_DATA_SIZE");
74 74
75bool display_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
76 (void)state;
77 (void)animation;
78 (void)state;
79 // Read the uGFX documentation for information how to use the displays
80 // http://wiki.ugfx.org/index.php/Main_Page
81 gdispClear(White);
82
83 // You can use static variables for things that can't be found in the animation
84 // or state structs, here we use the image
85
86 //gdispGBlitArea is a tricky function to use since it supports blitting part of the image
87 // if you have full screen image, then just use 128 and 32 for both source and target dimensions
88 gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
89
90 return false;
91}
92
93// Feel free to modify the animations below, or even add new ones if needed 75// Feel free to modify the animations below, or even add new ones if needed
94 76
95// Don't worry, if the startup animation is long, you can use the keyboard like normal 77// Don't worry, if the startup animation is long, you can use the keyboard like normal
@@ -99,7 +81,7 @@ static keyframe_animation_t startup_animation = {
99 .loop = false, 81 .loop = false,
100 .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0}, 82 .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0},
101 .frame_functions = { 83 .frame_functions = {
102 display_logo, 84 lcd_keyframe_draw_logo,
103 backlight_keyframe_animate_color, 85 backlight_keyframe_animate_color,
104 }, 86 },
105}; 87};
@@ -162,7 +144,7 @@ static keyframe_animation_t resume_animation = {
162 .frame_functions = { 144 .frame_functions = {
163 lcd_keyframe_enable, 145 lcd_keyframe_enable,
164 backlight_keyframe_enable, 146 backlight_keyframe_enable,
165 display_logo, 147 lcd_keyframe_draw_logo,
166 backlight_keyframe_animate_color, 148 backlight_keyframe_animate_color,
167 }, 149 },
168}; 150};
diff --git a/keyboards/ergodox/keymaps/default/visualizer.c b/keyboards/ergodox/keymaps/default/visualizer.c
index f03702f60..afa6f1bdd 100644
--- a/keyboards/ergodox/keymaps/default/visualizer.c
+++ b/keyboards/ergodox/keymaps/default/visualizer.c
@@ -46,24 +46,6 @@ typedef enum {
46 46
47static lcd_state_t lcd_state = LCD_STATE_INITIAL; 47static lcd_state_t lcd_state = LCD_STATE_INITIAL;
48 48
49bool display_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
50 (void)state;
51 (void)animation;
52 (void)state;
53 // Read the uGFX documentation for information how to use the displays
54 // http://wiki.ugfx.org/index.php/Main_Page
55 gdispClear(White);
56
57 // You can use static variables for things that can't be found in the animation
58 // or state structs, here we use the image
59
60 //gdispGBlitArea is a tricky function to use since it supports blitting part of the image
61 // if you have full screen image, then just use 128 and 32 for both source and target dimensions
62 gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
63
64 return false;
65}
66
67// Feel free to modify the animations below, or even add new ones if needed 49// Feel free to modify the animations below, or even add new ones if needed
68 50
69// Don't worry, if the startup animation is long, you can use the keyboard like normal 51// Don't worry, if the startup animation is long, you can use the keyboard like normal
@@ -73,7 +55,7 @@ static keyframe_animation_t startup_animation = {
73 .loop = false, 55 .loop = false,
74 .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0}, 56 .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0},
75 .frame_functions = { 57 .frame_functions = {
76 display_logo, 58 lcd_keyframe_draw_logo,
77 backlight_keyframe_animate_color, 59 backlight_keyframe_animate_color,
78 }, 60 },
79}; 61};
@@ -104,7 +86,7 @@ static keyframe_animation_t resume_animation = {
104 .frame_functions = { 86 .frame_functions = {
105 lcd_keyframe_enable, 87 lcd_keyframe_enable,
106 backlight_keyframe_enable, 88 backlight_keyframe_enable,
107 display_logo, 89 lcd_keyframe_draw_logo,
108 backlight_keyframe_animate_color, 90 backlight_keyframe_animate_color,
109 }, 91 },
110}; 92};
diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c
index c6e04d0ca..df11861dd 100644
--- a/quantum/visualizer/lcd_keyframes.c
+++ b/quantum/visualizer/lcd_keyframes.c
@@ -18,6 +18,7 @@
18#include <string.h> 18#include <string.h>
19#include "action_util.h" 19#include "action_util.h"
20#include "led.h" 20#include "led.h"
21#include "resources/resources.h"
21 22
22bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) { 23bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) {
23 (void)animation; 24 (void)animation;
@@ -154,6 +155,24 @@ bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation,
154 return false; 155 return false;
155} 156}
156 157
158bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
159 (void)state;
160 (void)animation;
161 // Read the uGFX documentation for information how to use the displays
162 // http://wiki.ugfx.org/index.php/Main_Page
163 gdispClear(White);
164
165 // You can use static variables for things that can't be found in the animation
166 // or state structs, here we use the image
167
168 //gdispGBlitArea is a tricky function to use since it supports blitting part of the image
169 // if you have full screen image, then just use 128 and 32 for both source and target dimensions
170 gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
171
172 return false;
173}
174
175
157bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { 176bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
158 (void)animation; 177 (void)animation;
159 (void)state; 178 (void)state;
diff --git a/quantum/visualizer/lcd_keyframes.h b/quantum/visualizer/lcd_keyframes.h
index 8f79a541c..2e912b4c7 100644
--- a/quantum/visualizer/lcd_keyframes.h
+++ b/quantum/visualizer/lcd_keyframes.h
@@ -29,6 +29,8 @@ bool lcd_keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualize
29bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state); 29bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
30// Displays both the layer text and the led states 30// Displays both the layer text and the led states
31bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state); 31bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
32// Displays the QMK logo on the LCD screen
33bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state);
32 34
33bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state); 35bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
34bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state); 36bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);