]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Move the logo drawing keyframe to lcd_keyframes
authorFred Sundvik <fsundvik@gmail.com>
Sat, 8 Apr 2017 18:30:11 +0000 (21:30 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Sun, 9 Apr 2017 15:34:59 +0000 (18:34 +0300)
keyboards/ergodox/infinity/visualizer.c
keyboards/ergodox/keymaps/default/visualizer.c
quantum/visualizer/lcd_keyframes.c
quantum/visualizer/lcd_keyframes.h

index 90933b00a4abf73499e7ad5b8c9b5c7ba0856c6c..bac85c593cf8ea1be4a5aa3de0de82b464843975 100644 (file)
@@ -72,24 +72,6 @@ static visualizer_user_data_t user_data_keyboard = {
 _Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
     "Please increase the VISUALIZER_USER_DATA_SIZE");
 
-bool display_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
-    (void)state;
-    (void)animation;
-    (void)state;
-    // Read the uGFX documentation for information how to use the displays
-    // http://wiki.ugfx.org/index.php/Main_Page
-    gdispClear(White);
-
-    // You can use static variables for things that can't be found in the animation
-    // or state structs, here we use the image
-
-    //gdispGBlitArea is a tricky function to use since it supports blitting part of the image
-    // if you have full screen image, then just use 128 and 32 for both source and target dimensions
-    gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
-
-    return false;
-}
-
 // 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
@@ -99,7 +81,7 @@ static keyframe_animation_t startup_animation = {
     .loop = false,
     .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0},
     .frame_functions = {
-            display_logo,
+            lcd_keyframe_draw_logo,
             backlight_keyframe_animate_color,
     },
 };
@@ -162,7 +144,7 @@ static keyframe_animation_t resume_animation = {
     .frame_functions = {
             lcd_keyframe_enable,
             backlight_keyframe_enable,
-            display_logo,
+            lcd_keyframe_draw_logo,
             backlight_keyframe_animate_color,
     },
 };
index f03702f60208a3f73afe1e4b890c81892c3e81ee..afa6f1bdd772c281f781b646308b559f8de92c16 100644 (file)
@@ -46,24 +46,6 @@ typedef enum {
 
 static lcd_state_t lcd_state = LCD_STATE_INITIAL;
 
-bool display_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
-    (void)state;
-    (void)animation;
-    (void)state;
-    // Read the uGFX documentation for information how to use the displays
-    // http://wiki.ugfx.org/index.php/Main_Page
-    gdispClear(White);
-
-    // You can use static variables for things that can't be found in the animation
-    // or state structs, here we use the image
-
-    //gdispGBlitArea is a tricky function to use since it supports blitting part of the image
-    // if you have full screen image, then just use 128 and 32 for both source and target dimensions
-    gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
-
-    return false;
-}
-
 // 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
@@ -73,7 +55,7 @@ static keyframe_animation_t startup_animation = {
     .loop = false,
     .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0},
     .frame_functions = {
-            display_logo,
+            lcd_keyframe_draw_logo,
             backlight_keyframe_animate_color,
     },
 };
@@ -104,7 +86,7 @@ static keyframe_animation_t resume_animation = {
     .frame_functions = {
             lcd_keyframe_enable,
             backlight_keyframe_enable,
-            display_logo,
+            lcd_keyframe_draw_logo,
             backlight_keyframe_animate_color,
     },
 };
index c6e04d0ca437e0a4b6aed374057cf05535f3c619..df11861ddc96256da0086c54852ca2c8cff8d4d5 100644 (file)
@@ -18,6 +18,7 @@
 #include <string.h>
 #include "action_util.h"
 #include "led.h"
+#include "resources/resources.h"
 
 bool lcd_keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) {
     (void)animation;
@@ -154,6 +155,24 @@ bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation,
     return false;
 }
 
+bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state) {
+    (void)state;
+    (void)animation;
+    // Read the uGFX documentation for information how to use the displays
+    // http://wiki.ugfx.org/index.php/Main_Page
+    gdispClear(White);
+
+    // You can use static variables for things that can't be found in the animation
+    // or state structs, here we use the image
+
+    //gdispGBlitArea is a tricky function to use since it supports blitting part of the image
+    // if you have full screen image, then just use 128 and 32 for both source and target dimensions
+    gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo);
+
+    return false;
+}
+
+
 bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
     (void)animation;
     (void)state;
index 8f79a541c88b92b6dd0c369d7e62d12912f252a9..2e912b4c73d27ee703ee053a8e046331ffcec801 100644 (file)
@@ -29,6 +29,8 @@ bool lcd_keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualize
 bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
 // Displays both the layer text and the led states
 bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
+// Displays the QMK logo on the LCD screen
+bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t* state);
 
 bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
 bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);