]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Combine startup and resume animations
authorFred Sundvik <fsundvik@gmail.com>
Sat, 8 Apr 2017 19:30:37 +0000 (22:30 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Sun, 9 Apr 2017 15:34:59 +0000 (18:34 +0300)
keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c
keyboards/ergodox/infinity/visualizer.c
quantum/visualizer/lcd_backlight.c

index 5b7b6d44c43b021c1d51986f505af9510e2f47aa..b04ad029358fe27006a3ff78b30e065cb0368830 100644 (file)
@@ -127,7 +127,6 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
 
     write_cmd(g, ST7565_INVERT_DISPLAY);
     write_cmd(g, ST7565_ALLON_NORMAL);
-    write_cmd(g, ST7565_DISPLAY_ON);
 
     write_cmd(g, ST7565_START_LINE | 0);
     write_cmd(g, ST7565_RMW);
@@ -143,7 +142,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
     g->g.Width = GDISP_SCREEN_WIDTH;
     g->g.Height = GDISP_SCREEN_HEIGHT;
     g->g.Orientation = GDISP_ROTATE_0;
-    g->g.Powermode = powerOn;
+    g->g.Powermode = powerOff;
     g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
     g->g.Contrast = GDISP_INITIAL_CONTRAST;
     return TRUE;
index 8c3f3f29fcca26101be5e0fb9032d91f6efd79cc..7ae371c5fc1b3836b34b02a1495732e7ed934daf 100644 (file)
@@ -77,10 +77,12 @@ _Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
 // 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,
+    .num_frames = 4,
     .loop = false,
-    .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0},
+    .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(10000), 0},
     .frame_functions = {
+            lcd_keyframe_enable,
+            backlight_keyframe_enable,
             lcd_keyframe_draw_logo,
             backlight_keyframe_animate_color,
     },
@@ -137,18 +139,6 @@ static keyframe_animation_t suspend_animation = {
     },
 };
 
-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.
@@ -312,7 +302,7 @@ 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(&startup_animation);
 }
 
 void ergodox_board_led_on(void){
index 70187d1e000fb91914a7ca618f71e8ef0094d123..00de3fab52d4a6cf1dc0e5e83d4644f1a34f484e 100644 (file)
@@ -25,10 +25,10 @@ SOFTWARE.
 #include "lcd_backlight.h"
 #include <math.h>
 
-static uint8_t current_hue = 0x00;
-static uint8_t current_saturation = 0x00;
-static uint8_t current_intensity = 0xFF;
-static uint8_t current_brightness = 0x7F;
+static uint8_t current_hue = 0;
+static uint8_t current_saturation = 0;
+static uint8_t current_intensity = 0;
+static uint8_t current_brightness = 0;
 
 void lcd_backlight_init(void) {
     lcd_backlight_hal_init();