Skip to content

Commit

Permalink
Shared default animations
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo authored and jackhumbert committed Jul 10, 2017
1 parent 2251560 commit 4da3b19
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 171 deletions.
3 changes: 1 addition & 2 deletions keyboards/ergodox/infinity/rules.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# project specific files
SRC = matrix.c \
led.c \
animations.c
led.c

## chip/board settings
# - the next two should match the directories in
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ergodox/infinity/simple_visualizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "lcd_backlight_keyframes.h"
#include "system/serial_link.h"
#include "led.h"
#include "animations.h"
#include "default_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);
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ergodox/infinity/visualizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +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 "animations.h"
#include "default_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);
Expand Down
128 changes: 0 additions & 128 deletions keyboards/whitefox/animations.c

This file was deleted.

30 changes: 0 additions & 30 deletions keyboards/whitefox/animations.h

This file was deleted.

3 changes: 1 addition & 2 deletions keyboards/whitefox/rules.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# project specific files
SRC = matrix.c \
led.c \
animations.c
led.c

## chip/board settings
# - the next two should match the directories in
Expand Down
2 changes: 1 addition & 1 deletion keyboards/whitefox/visualizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "visualizer.h"
#include "visualizer_keyframes.h"
#include "led.h"
#include "animations.h"
#include "default_animations.h"


static bool initial_update = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#if defined(VISUALIZER_ENABLE)

#include "animations.h"
#include "default_animations.h"
#include "visualizer.h"
#ifdef LCD_ENABLE
#include "lcd_keyframes.h"
Expand Down Expand Up @@ -86,22 +86,44 @@ static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_
// Don't worry, if the startup animation is long, you can use the keyboard like normal
// during that time
keyframe_animation_t default_startup_animation = {
#if LCD_ENABLE
.num_frames = 3,
#else
.num_frames = 2,
#endif
.loop = false,
.frame_lengths = {0, 0, gfxMillisecondsToTicks(5000)},
.frame_lengths = {
0,
#if LCD_ENABLE
0,
#endif
gfxMillisecondsToTicks(5000)},
.frame_functions = {
keyframe_enable,
#if LCD_ENABLE
lcd_keyframe_draw_logo,
#endif
keyframe_fade_in,
},
};

keyframe_animation_t default_suspend_animation = {
#if LCD_ENABLE
.num_frames = 3,
#else
.num_frames = 2,
#endif
.loop = false,
.frame_lengths = {0, gfxMillisecondsToTicks(1000), 0},
.frame_lengths = {
#if LCD_ENABLE
0,
#endif
gfxMillisecondsToTicks(1000),
0},
.frame_functions = {
#if LCD_ENABLE
lcd_keyframe_display_layer_text,
#endif
keyframe_fade_out,
keyframe_disable,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
#define KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
#ifndef DEFAULT_ANIMATIONS_H_
#define DEFAULT_ANIMATIONS_H_

#include "visualizer.h"

Expand All @@ -27,4 +27,4 @@ extern keyframe_animation_t default_suspend_animation;
// cases
extern keyframe_animation_t led_test_animation;

#endif /* KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ */
#endif /* DEFAULT_ANIMATIONS_H_ */
2 changes: 2 additions & 0 deletions quantum/visualizer/visualizer.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
SRC += $(VISUALIZER_DIR)/led_backlight_keyframes.c
endif

SRC += $(VISUALIZER_DIR)/default_animations.c

include $(GFXLIB)/gfx.mk
# For the common_gfxconf.h
GFXINC += quantum/visualizer
Expand Down

0 comments on commit 4da3b19

Please sign in to comment.