From aee9b10e92a597984ba9693b2dfcf597ca380a70 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 23:45:39 +0300 Subject: Add a keyboard specific visualizer --- keyboards/ergodox/infinity/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/ergodox/infinity/rules.mk') diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk index 473a6dfec..1b011cd58 100644 --- a/keyboards/ergodox/infinity/rules.mk +++ b/keyboards/ergodox/infinity/rules.mk @@ -59,7 +59,7 @@ OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 # CUSTOM_MATRIX ?= yes # Custom matrix file SERIAL_LINK_ENABLE = yes -VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile +VISUALIZER_ENABLE ?= yes LCD_ENABLE ?= yes LED_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes -- cgit v1.2.3 From bb86be1f1f3927a7ce339cb9439c97914af24754 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 28 Aug 2016 23:08:34 +0300 Subject: Remove unneeded makefile include --- keyboards/ergodox/ez/rules.mk | 4 ---- keyboards/ergodox/infinity/rules.mk | 4 ---- 2 files changed, 8 deletions(-) (limited to 'keyboards/ergodox/infinity/rules.mk') diff --git a/keyboards/ergodox/ez/rules.mk b/keyboards/ergodox/ez/rules.mk index 64b2db815..6cd1c0c4f 100644 --- a/keyboards/ergodox/ez/rules.mk +++ b/keyboards/ergodox/ez/rules.mk @@ -74,7 +74,3 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 SLEEP_LED_ENABLE = no API_SYSEX_ENABLE ?= no RGBLIGHT_ENABLE ?= yes - -ifndef QUANTUM_DIR - include ../../../Makefile -endif diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk index 1b011cd58..d51574aca 100644 --- a/keyboards/ergodox/infinity/rules.mk +++ b/keyboards/ergodox/infinity/rules.mk @@ -66,10 +66,6 @@ LCD_BACKLIGHT_ENABLE ?= yes MIDI_ENABLE = no RGBLIGHT_ENABLE = no -ifndef QUANTUM_DIR - include ../../../Makefile -endif - ifdef LCD_ENABLE include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk endif -- cgit v1.2.3 From bc97413bf70b1906b387dea35bb22575ec57eff8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 1 Apr 2017 16:38:12 +0300 Subject: Disable LEDs on Infinity Ergodox --- keyboards/ergodox/infinity/rules.mk | 2 +- keyboards/ergodox/infinity/visualizer.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'keyboards/ergodox/infinity/rules.mk') diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk index d51574aca..aaadfe34b 100644 --- a/keyboards/ergodox/infinity/rules.mk +++ b/keyboards/ergodox/infinity/rules.mk @@ -61,7 +61,7 @@ CUSTOM_MATRIX ?= yes # Custom matrix file SERIAL_LINK_ENABLE = yes VISUALIZER_ENABLE ?= yes LCD_ENABLE ?= yes -LED_ENABLE ?= yes +LED_ENABLE ?= no LCD_BACKLIGHT_ENABLE ?= yes MIDI_ENABLE = no RGBLIGHT_ENABLE = no diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c index 0ce1d4ae4..c8fc3d78e 100644 --- a/keyboards/ergodox/infinity/visualizer.c +++ b/keyboards/ergodox/infinity/visualizer.c @@ -27,7 +27,6 @@ along with this program. If not, see . #endif #include "visualizer.h" -#include "led_test.h" // To generate an image array like this // Ensure the image is 128 x 32 or smaller @@ -205,5 +204,4 @@ void user_visualizer_resume(visualizer_state_t* state) { state->current_lcd_color = initial_color; state->target_lcd_color = logo_background_color; start_keyframe_animation(&resume_animation); - start_keyframe_animation(&led_test_animation); } -- cgit v1.2.3 From 306353bf06e5e5a76890ffb0c48a4dcca76c4399 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 8 Apr 2017 22:48:18 +0300 Subject: Create a file for shared Ergodox Infinity animations --- keyboards/ergodox/infinity/animations.c | 54 ++++++++++++++++++++++++++ keyboards/ergodox/infinity/animations.h | 25 ++++++++++++ keyboards/ergodox/infinity/rules.mk | 5 ++- keyboards/ergodox/infinity/visualizer.c | 38 ++---------------- keyboards/ergodox/keymaps/default/visualizer.c | 45 ++------------------- 5 files changed, 90 insertions(+), 77 deletions(-) create mode 100644 keyboards/ergodox/infinity/animations.c create mode 100644 keyboards/ergodox/infinity/animations.h (limited to 'keyboards/ergodox/infinity/rules.mk') diff --git a/keyboards/ergodox/infinity/animations.c b/keyboards/ergodox/infinity/animations.c new file mode 100644 index 000000000..54ab99460 --- /dev/null +++ b/keyboards/ergodox/infinity/animations.c @@ -0,0 +1,54 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "animations.h" +#include "visualizer.h" +#ifdef LCD_ENABLE +#include "lcd_keyframes.h" +#endif +#ifdef LCD_BACKLIGHT_ENABLE +#include "lcd_backlight_keyframes.h" +#endif + +#if defined(VISUALIZER_ENABLE) && defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE) + +// 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 = { + .num_frames = 4, + .loop = false, + .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0}, + .frame_functions = { + lcd_keyframe_enable, + backlight_keyframe_enable, + lcd_keyframe_draw_logo, + backlight_keyframe_animate_color, + }, +}; + +keyframe_animation_t default_suspend_animation = { + .num_frames = 4, + .loop = false, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0}, + .frame_functions = { + lcd_keyframe_display_layer_text, + backlight_keyframe_animate_color, + lcd_keyframe_disable, + backlight_keyframe_disable, + }, +}; + +#endif diff --git a/keyboards/ergodox/infinity/animations.h b/keyboards/ergodox/infinity/animations.h new file mode 100644 index 000000000..0c441ff7e --- /dev/null +++ b/keyboards/ergodox/infinity/animations.h @@ -0,0 +1,25 @@ +/* Copyright 2017 Fred Sundvik + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ +#define KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ + +#include "visualizer.h" + +extern keyframe_animation_t default_startup_animation; +extern keyframe_animation_t default_suspend_animation; + +#endif /* KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ */ diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk index aaadfe34b..9e6170d89 100644 --- a/keyboards/ergodox/infinity/rules.mk +++ b/keyboards/ergodox/infinity/rules.mk @@ -1,6 +1,7 @@ # project specific files SRC = matrix.c \ - led.c + led.c \ + animations.c ## chip/board settings # - the next two should match the directories in @@ -72,4 +73,4 @@ endif ifdef LED_ENABLE include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk -endif +endif \ No newline at end of file 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 . #include "lcd_keyframes.h" #include "lcd_backlight_keyframes.h" #include "system/serial_link.h" - -#include "resources/resources.h" +#include "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); @@ -74,19 +73,6 @@ _Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE, // 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 -// during that time -static keyframe_animation_t startup_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, - }, -}; // The color animation animates the LCD color when you change layers static keyframe_animation_t one_led_color = { @@ -127,18 +113,6 @@ static keyframe_animation_t lcd_bitmap_leds_animation = { .frame_functions = {lcd_keyframe_display_layer_bitmap, lcd_keyframe_display_led_states}, }; -static keyframe_animation_t suspend_animation = { - .num_frames = 4, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0}, - .frame_functions = { - lcd_keyframe_display_layer_text, - backlight_keyframe_animate_color, - lcd_keyframe_disable, - backlight_keyframe_disable, - }, -}; - void initialize_user_visualizer(visualizer_state_t* state) { // The brightness will be dynamically adjustable in the future // But for now, change it here. @@ -146,13 +120,9 @@ void initialize_user_visualizer(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(&startup_animation); + start_keyframe_animation(&default_startup_animation); } -static const uint32_t red; -static const uint32_t green; -static const uint32_t blue; - inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) { return user_data->led_on & (1u << num); } @@ -295,14 +265,14 @@ void user_visualizer_suspend(visualizer_state_t* state) { uint8_t hue = LCD_HUE(state->current_lcd_color); uint8_t sat = LCD_SAT(state->current_lcd_color); state->target_lcd_color = LCD_COLOR(hue, sat, 0); - start_keyframe_animation(&suspend_animation); + start_keyframe_animation(&default_suspend_animation); } 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(&startup_animation); + start_keyframe_animation(&default_startup_animation); } void ergodox_board_led_on(void){ diff --git a/keyboards/ergodox/keymaps/default/visualizer.c b/keyboards/ergodox/keymaps/default/visualizer.c index 6a7178968..779de0050 100644 --- a/keyboards/ergodox/keymaps/default/visualizer.c +++ b/keyboards/ergodox/keymaps/default/visualizer.c @@ -32,8 +32,7 @@ along with this program. If not, see . #include "lcd_backlight_keyframes.h" #include "system/serial_link.h" #include "led.h" - -#include "resources/resources.h" +#include "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); @@ -48,18 +47,6 @@ static lcd_state_t lcd_state = LCD_STATE_INITIAL; // 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 -// during that time -static keyframe_animation_t startup_animation = { - .num_frames = 2, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(10000), 0}, - .frame_functions = { - lcd_keyframe_draw_logo, - backlight_keyframe_animate_color, - }, -}; - static keyframe_animation_t lcd_layer_display = { .num_frames = 1, .loop = false, @@ -67,30 +54,6 @@ static keyframe_animation_t lcd_layer_display = { .frame_functions = {lcd_keyframe_display_layer_and_led_states} }; -static keyframe_animation_t suspend_animation = { - .num_frames = 4, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0}, - .frame_functions = { - lcd_keyframe_display_layer_text, - backlight_keyframe_animate_color, - lcd_keyframe_disable, - backlight_keyframe_disable, - }, -}; - -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, - }, -}; - // The color animation animates the LCD color when you change layers static keyframe_animation_t color_animation = { .num_frames = 2, @@ -109,7 +72,7 @@ void initialize_user_visualizer(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(&startup_animation); + start_keyframe_animation(&default_startup_animation); } void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status) { @@ -156,12 +119,12 @@ void user_visualizer_suspend(visualizer_state_t* state) { uint8_t hue = LCD_HUE(state->current_lcd_color); uint8_t sat = LCD_SAT(state->current_lcd_color); state->target_lcd_color = LCD_COLOR(hue, sat, 0); - start_keyframe_animation(&suspend_animation); + start_keyframe_animation(&default_suspend_animation); } 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(&default_startup_animation); } -- cgit v1.2.3