From 9a4ce28683b667ab67d48d92196bab7e277d4800 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 1 Apr 2017 22:52:58 +0300 Subject: Display layer bitmap and keyboard led states on the LCD --- quantum/visualizer/visualizer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 315af50228..2c81cb9f71 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -136,6 +136,8 @@ bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_sta bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); // Displays a bitmap (0/1) of all the currently active mods bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); +// Displays the keyboard led states (CAPS (Caps lock), NUM (Num lock), SCRL (Scroll lock), COMP (Compose), KANA) +bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); @@ -146,7 +148,7 @@ bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* s // These functions have to be implemented by the user void initialize_user_visualizer(visualizer_state_t* state); -void update_user_visualizer_state(visualizer_state_t* state); +void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t prev_status); void user_visualizer_suspend(visualizer_state_t* state); void user_visualizer_resume(visualizer_state_t* state); -- cgit v1.2.3 From 39385144e7dc3337e623cdc8147b4a441f22fd62 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 2 Apr 2017 01:31:04 +0300 Subject: Emulate Ergodox EZ leds by LCD colors --- quantum/visualizer/visualizer.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 2c81cb9f71..beb8f2ab41 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -68,6 +68,9 @@ typedef struct { uint8_t mods; uint32_t leds; // See led.h for available statuses bool suspended; +#ifdef VISUALIZER_USER_DATA_SIZE + uint8_t user_data[VISUALIZER_USER_DATA_SIZE]; +#endif } visualizer_keyboard_status_t; // The state struct is used by the various keyframe functions @@ -146,6 +149,11 @@ bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualiz // directly from the initalize_user_visualizer function (the animation can be null) bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); +// The master can set userdata which will be transferred to the slave +#ifdef VISUALIZER_USER_DATA_SIZE +void visualizer_set_user_data(void* user_data); +#endif + // These functions have to be implemented by the user void initialize_user_visualizer(visualizer_state_t* state); void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t prev_status); -- cgit v1.2.3 From 5fbaf31dc26a7bb27eb276ec419255e92b293d60 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 2 Apr 2017 02:29:50 +0300 Subject: Brightness for Ergodox Infinity emulated LEDs --- quantum/visualizer/visualizer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index beb8f2ab41..e8ace5b37b 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -156,7 +156,7 @@ void visualizer_set_user_data(void* user_data); // These functions have to be implemented by the user void initialize_user_visualizer(visualizer_state_t* state); -void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t prev_status); +void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status); void user_visualizer_suspend(visualizer_state_t* state); void user_visualizer_resume(visualizer_state_t* state); -- cgit v1.2.3 From 05bc4880ddc9e904cfa1773caff1ae81977d2a76 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 4 Apr 2017 22:29:40 +0300 Subject: Tweaks to the Ergodox default visualizer No animation, display led statuses and layer name on the same screen Don't display layer bitmap Fully saturated colors for caps, less saturated ones normally --- quantum/visualizer/visualizer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index e8ace5b37b..3b05c305e2 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -141,6 +141,7 @@ bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_s bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); // Displays the keyboard led states (CAPS (Caps lock), NUM (Num lock), SCRL (Scroll lock), COMP (Compose), KANA) bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state); +bool keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); -- cgit v1.2.3 From 5815c5d317b02d688990980fdf01848e81247c21 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 5 Apr 2017 08:40:39 +0300 Subject: Move LCD keyframes to its own file --- quantum/visualizer/visualizer.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 3b05c305e2..440044fd3d 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -133,15 +133,6 @@ bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state); // Sets the backlight color to the target color bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state); -// Displays the layer text centered vertically on the screen -bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state); -// Displays a bitmap (0/1) of all the currently active layers -bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); -// Displays a bitmap (0/1) of all the currently active mods -bool keyframe_display_mods_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); -// Displays the keyboard led states (CAPS (Caps lock), NUM (Num lock), SCRL (Scroll lock), COMP (Compose), KANA) -bool keyframe_display_led_states(keyframe_animation_t* animation, visualizer_state_t* state); -bool keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); -- cgit v1.2.3 From 5ba228b684a32c1099efc6207842a56ff102961a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 5 Apr 2017 08:48:30 +0300 Subject: Move LCD backlight keyframes to its own file --- quantum/visualizer/visualizer.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 440044fd3d..5c870dbfe9 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -129,10 +129,6 @@ void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* stat // Some predefined keyframe functions that can be used by the user code // Does nothing, useful for adding delays bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); -// Animates the LCD backlight color between the current color and the target color (of the state) -bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state); -// Sets the backlight color to the target color -bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); -- cgit v1.2.3 From 1e7585e76771e1a2d8ca733fc09c19f9fa0e903c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 5 Apr 2017 09:21:18 +0300 Subject: Separated backlight and LCD disable/enable Also moved them to correct places --- quantum/visualizer/visualizer.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 5c870dbfe9..f37ce8416e 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -130,9 +130,6 @@ void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* stat // Does nothing, useful for adding delays bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); -bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); -bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); - // Call this once, when the initial animation has finished, alternatively you can call it // directly from the initalize_user_visualizer function (the animation can be null) bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); -- cgit v1.2.3 From 64d63ab42281318d891434fbc00277043298dd70 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 5 Apr 2017 10:08:25 +0300 Subject: Remove the need to manually enable the visualizer --- quantum/visualizer/visualizer.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index f37ce8416e..4639348492 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -130,20 +130,22 @@ void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* stat // Does nothing, useful for adding delays bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); -// Call this once, when the initial animation has finished, alternatively you can call it -// directly from the initalize_user_visualizer function (the animation can be null) -bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); - // The master can set userdata which will be transferred to the slave #ifdef VISUALIZER_USER_DATA_SIZE void visualizer_set_user_data(void* user_data); #endif // These functions have to be implemented by the user -void initialize_user_visualizer(visualizer_state_t* state); +// Called regularly each time the state has changed (but not every scan loop) void update_user_visualizer_state(visualizer_state_t* state, visualizer_keyboard_status_t* prev_status); +// Called when the computer goes to suspend, will also stop calling update_user_visualizer_state void user_visualizer_suspend(visualizer_state_t* state); +// You have to start at least one animation as a response to the following two functions +// When the animation has finished the visualizer will resume normal operation and start calling the +// update_user_visualizer_state again +// Called when the keyboard boots up +void initialize_user_visualizer(visualizer_state_t* state); +// Called when the computer resumes from a suspend void user_visualizer_resume(visualizer_state_t* state); - #endif /* VISUALIZER_H */ -- cgit v1.2.3 From b7041d06aef4dcf2f2a47504a699e538cfb1d9ac Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 5 Apr 2017 10:14:24 +0300 Subject: Move common visualizer keyframes into visualizer_keyframes.h --- quantum/visualizer/visualizer.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'quantum/visualizer/visualizer.h') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 4639348492..d6f279e101 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -34,7 +34,7 @@ SOFTWARE. #include "lcd_backlight.h" #endif -// use this function to merget both real_mods and oneshot_mods in a uint16_t +// use this function to merge both real_mods and oneshot_mods in a uint16_t uint8_t visualizer_get_mods(void); // This need to be called once at the start @@ -126,10 +126,6 @@ void stop_keyframe_animation(keyframe_animation_t* animation); // Useful for crossfades for example void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); -// Some predefined keyframe functions that can be used by the user code -// Does nothing, useful for adding delays -bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); - // The master can set userdata which will be transferred to the slave #ifdef VISUALIZER_USER_DATA_SIZE void visualizer_set_user_data(void* user_data); -- cgit v1.2.3