aboutsummaryrefslogtreecommitdiff
path: root/quantum/visualizer
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/visualizer')
-rw-r--r--quantum/visualizer/lcd_keyframes.c4
-rw-r--r--quantum/visualizer/led_backlight_keyframes.c4
-rw-r--r--quantum/visualizer/visualizer.mk35
3 files changed, 39 insertions, 4 deletions
diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c
index 82e4184d2..75eb45700 100644
--- a/quantum/visualizer/lcd_keyframes.c
+++ b/quantum/visualizer/lcd_keyframes.c
@@ -166,8 +166,8 @@ bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t*
166 // or state structs, here we use the image 166 // or state structs, here we use the image
167 167
168 //gdispGBlitArea is a tricky function to use since it supports blitting part of the image 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 169 // if you have full screen image, then just use LCD_WIDTH and LCD_HEIGHT for both source and target dimensions
170 gdispGBlitArea(GDISP, 0, 0, 128, 32, 0, 0, 128, (pixel_t*)resource_lcd_logo); 170 gdispGBlitArea(GDISP, 0, 0, LCD_WIDTH, LCD_HEIGHT, 0, 0, LCD_WIDTH, (pixel_t*)resource_lcd_logo);
171 171
172 return false; 172 return false;
173} 173}
diff --git a/quantum/visualizer/led_backlight_keyframes.c b/quantum/visualizer/led_backlight_keyframes.c
index d2921a391..eb3f5561d 100644
--- a/quantum/visualizer/led_backlight_keyframes.c
+++ b/quantum/visualizer/led_backlight_keyframes.c
@@ -41,8 +41,8 @@ static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint
41} 41}
42 42
43// TODO: Should be customizable per keyboard 43// TODO: Should be customizable per keyboard
44#define NUM_ROWS LED_NUM_ROWS 44#define NUM_ROWS LED_HEIGHT
45#define NUM_COLS LED_NUM_COLS 45#define NUM_COLS LED_WIDTH
46 46
47static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; 47static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS];
48static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; 48static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS];
diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk
index 3a0f771bc..102d23b7e 100644
--- a/quantum/visualizer/visualizer.mk
+++ b/quantum/visualizer/visualizer.mk
@@ -20,6 +20,30 @@
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE. 21# SOFTWARE.
22 22
23define ADD_DRIVER
24 $(1)_DRIVER:=$(strip $($(1)_DRIVER))
25 $(1)_WIDTH:=$(strip $($(1)_WIDTH))
26 $(1)_HEIGHT:=$(strip $($(1)_HEIGHT))
27 ifeq ($($(1)_DRIVER),)
28 $$(error $(1)_DRIVER is not defined)
29 endif
30 ifeq ($($(1)_WIDTH),)
31 $$(error $(1)_WIDTH is not defined)
32 endif
33 ifeq ($($(1)_HEIGHT),)
34 $$(error $(1)_HEIGHT is not defined)
35 endif
36 OPT_DEFS+=-D$(1)_WIDTH=$($(1)_WIDTH)
37 OPT_DEFS+=-D$(1)_HEIGHT=$($(1)_HEIGHT)
38 GFXDEFS+=-D$(1)_WIDTH=$($(1)_WIDTH)
39 GFXDEFS+=-D$(1)_HEIGHT=$($(1)_HEIGHT)
40 $(1)_DISPLAY_NUMBER:=$$(words $$(GDISP_DRIVER_LIST))
41 OPT_DEFS+=-D$(1)_DISPLAY_NUMBER=$$($(1)_DISPLAY_NUMBER)
42 include $(TOP_DIR)/drivers/ugfx/gdisp/$($(1)_DRIVER)/driver.mk
43endef
44
45GDISP_DRIVER_LIST:=
46
23SRC += $(VISUALIZER_DIR)/visualizer.c \ 47SRC += $(VISUALIZER_DIR)/visualizer.c \
24 $(VISUALIZER_DIR)/visualizer_keyframes.c 48 $(VISUALIZER_DIR)/visualizer_keyframes.c
25EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) 49EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR)
@@ -40,10 +64,12 @@ SRC += $(VISUALIZER_DIR)/lcd_backlight_keyframes.c
40# Note, that the linker will strip out any resources that are not actually in use 64# Note, that the linker will strip out any resources that are not actually in use
41SRC += $(VISUALIZER_DIR)/resources/lcd_logo.c 65SRC += $(VISUALIZER_DIR)/resources/lcd_logo.c
42OPT_DEFS += -DLCD_BACKLIGHT_ENABLE 66OPT_DEFS += -DLCD_BACKLIGHT_ENABLE
67$(eval $(call ADD_DRIVER,LCD))
43endif 68endif
44 69
45ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) 70ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
46SRC += $(VISUALIZER_DIR)/led_backlight_keyframes.c 71SRC += $(VISUALIZER_DIR)/led_backlight_keyframes.c
72$(eval $(call ADD_DRIVER,LED))
47endif 73endif
48 74
49SRC += $(VISUALIZER_DIR)/default_animations.c 75SRC += $(VISUALIZER_DIR)/default_animations.c
@@ -55,6 +81,15 @@ GFXINC += quantum/visualizer
55GFXSRC := $(patsubst $(TOP_DIR)/%,%,$(GFXSRC)) 81GFXSRC := $(patsubst $(TOP_DIR)/%,%,$(GFXSRC))
56GFXDEFS := $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) 82GFXDEFS := $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS)))
57 83
84GDISP_LIST_COMMA=,
85GDISP_LIST_EMPTY=
86GDISP_LIST_SPACE=$(GDISP_LIST_EMPTY) $(GDISP_LIST_EMPTY)
87
88GDISP_DRIVER_LIST := $(strip $(GDISP_DRIVER_LIST))
89GDISP_DRIVER_LIST := $(subst $(GDISP_LIST_SPACE),$(GDISP_LIST_COMMA),$(GDISP_DRIVER_LIST))
90
91GFXDEFS +=-DGDISP_DRIVER_LIST="$(GDISP_DRIVER_LIST)"
92
58ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","") 93ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","")
59 SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c 94 SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c
60else 95else