aboutsummaryrefslogtreecommitdiff
path: root/quantum/visualizer
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-07-09 17:46:51 +0300
committerJack Humbert <jack.humb@gmail.com>2017-07-10 09:01:59 -0400
commit2251560256ff1a139178dc80b18dd8ef1d8e83d6 (patch)
tree51f39e49e40dc3cfa2bafeff51c32d992f1d10f5 /quantum/visualizer
parentf3c113fb5a5ea89762b5c51d5d182093f6fb999d (diff)
downloadqmk_firmware-2251560256ff1a139178dc80b18dd8ef1d8e83d6.tar.gz
qmk_firmware-2251560256ff1a139178dc80b18dd8ef1d8e83d6.zip
Clarify naming between LCD_BACKLIGHT and LED_BACKLIGHT
Diffstat (limited to 'quantum/visualizer')
-rw-r--r--quantum/visualizer/lcd_backlight_keyframes.c8
-rw-r--r--quantum/visualizer/lcd_backlight_keyframes.h30
-rw-r--r--quantum/visualizer/led_backlight_keyframes.c (renamed from quantum/visualizer/led_keyframes.c)20
-rw-r--r--quantum/visualizer/led_backlight_keyframes.h (renamed from quantum/visualizer/led_keyframes.h)22
-rw-r--r--quantum/visualizer/visualizer.mk2
5 files changed, 26 insertions, 56 deletions
diff --git a/quantum/visualizer/lcd_backlight_keyframes.c b/quantum/visualizer/lcd_backlight_keyframes.c
index 8436d4e3d..8c402baf6 100644
--- a/quantum/visualizer/lcd_backlight_keyframes.c
+++ b/quantum/visualizer/lcd_backlight_keyframes.c
@@ -16,7 +16,7 @@
16 16
17#include "lcd_backlight_keyframes.h" 17#include "lcd_backlight_keyframes.h"
18 18
19bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state) { 19bool lcd_backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state) {
20 int frame_length = animation->frame_lengths[animation->current_frame]; 20 int frame_length = animation->frame_lengths[animation->current_frame];
21 int current_pos = frame_length - animation->time_left_in_frame; 21 int current_pos = frame_length - animation->time_left_in_frame;
22 uint8_t t_h = LCD_HUE(state->target_lcd_color); 22 uint8_t t_h = LCD_HUE(state->target_lcd_color);
@@ -49,7 +49,7 @@ bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualize
49 return true; 49 return true;
50} 50}
51 51
52bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state) { 52bool lcd_backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state) {
53 (void)animation; 53 (void)animation;
54 state->prev_lcd_color = state->target_lcd_color; 54 state->prev_lcd_color = state->target_lcd_color;
55 state->current_lcd_color = state->target_lcd_color; 55 state->current_lcd_color = state->target_lcd_color;
@@ -60,14 +60,14 @@ bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_st
60 return false; 60 return false;
61} 61}
62 62
63bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { 63bool lcd_backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
64 (void)animation; 64 (void)animation;
65 (void)state; 65 (void)state;
66 lcd_backlight_hal_color(0, 0, 0); 66 lcd_backlight_hal_color(0, 0, 0);
67 return false; 67 return false;
68} 68}
69 69
70bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { 70bool lcd_backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
71 (void)animation; 71 (void)animation;
72 (void)state; 72 (void)state;
73 lcd_backlight_color(LCD_HUE(state->current_lcd_color), 73 lcd_backlight_color(LCD_HUE(state->current_lcd_color),
diff --git a/quantum/visualizer/lcd_backlight_keyframes.h b/quantum/visualizer/lcd_backlight_keyframes.h
deleted file mode 100644
index e1c125cf9..000000000
--- a/quantum/visualizer/lcd_backlight_keyframes.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/* Copyright 2017 Fred Sundvik
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
18#define QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
19
20#include "visualizer.h"
21
22// Animates the LCD backlight color between the current color and the target color (of the state)
23bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state);
24// Sets the backlight color to the target color
25bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state);
26
27bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
28bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
29
30#endif /* QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_ */
diff --git a/quantum/visualizer/led_keyframes.c b/quantum/visualizer/led_backlight_keyframes.c
index 7e6e5d1ab..d2921a391 100644
--- a/quantum/visualizer/led_keyframes.c
+++ b/quantum/visualizer/led_backlight_keyframes.c
@@ -23,7 +23,7 @@ SOFTWARE.
23*/ 23*/
24#include "gfx.h" 24#include "gfx.h"
25#include "math.h" 25#include "math.h"
26#include "led_keyframes.h" 26#include "led_backlight_keyframes.h"
27 27
28static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) { 28static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) {
29 int frame_length = animation->frame_lengths[animation->current_frame]; 29 int frame_length = animation->frame_lengths[animation->current_frame];
@@ -55,19 +55,19 @@ static uint8_t compute_gradient_color(float t, float index, float num) {
55 return (uint8_t)(255.0f * v); 55 return (uint8_t)(255.0f * v);
56} 56}
57 57
58bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state) { 58bool led_backlight_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state) {
59 (void)state; 59 (void)state;
60 keyframe_fade_all_leds_from_to(animation, 0, 255); 60 keyframe_fade_all_leds_from_to(animation, 0, 255);
61 return true; 61 return true;
62} 62}
63 63
64bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state) { 64bool led_backlight_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state) {
65 (void)state; 65 (void)state;
66 keyframe_fade_all_leds_from_to(animation, 255, 0); 66 keyframe_fade_all_leds_from_to(animation, 255, 0);
67 return true; 67 return true;
68} 68}
69 69
70bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { 70bool led_backlight_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
71 (void)state; 71 (void)state;
72 float frame_length = animation->frame_lengths[animation->current_frame]; 72 float frame_length = animation->frame_lengths[animation->current_frame];
73 float current_pos = frame_length - animation->time_left_in_frame; 73 float current_pos = frame_length - animation->time_left_in_frame;
@@ -79,7 +79,7 @@ bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visual
79 return true; 79 return true;
80} 80}
81 81
82bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { 82bool led_backlight_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
83 (void)state; 83 (void)state;
84 float frame_length = animation->frame_lengths[animation->current_frame]; 84 float frame_length = animation->frame_lengths[animation->current_frame];
85 float current_pos = frame_length - animation->time_left_in_frame; 85 float current_pos = frame_length - animation->time_left_in_frame;
@@ -98,7 +98,7 @@ static void copy_current_led_state(uint8_t* dest) {
98 } 98 }
99 } 99 }
100} 100}
101bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) { 101bool led_backlight_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) {
102 (void)state; 102 (void)state;
103 if (animation->first_update_of_frame) { 103 if (animation->first_update_of_frame) {
104 copy_current_led_state(&crossfade_start_frame[0][0]); 104 copy_current_led_state(&crossfade_start_frame[0][0]);
@@ -114,28 +114,28 @@ bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t*
114 return true; 114 return true;
115} 115}
116 116
117bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { 117bool led_backlight_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
118 (void)state; 118 (void)state;
119 (void)animation; 119 (void)animation;
120 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); 120 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180);
121 return false; 121 return false;
122} 122}
123 123
124bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { 124bool led_backlight_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
125 (void)state; 125 (void)state;
126 (void)animation; 126 (void)animation;
127 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); 127 gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0);
128 return false; 128 return false;
129} 129}
130 130
131bool led_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { 131bool led_backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
132 (void)state; 132 (void)state;
133 (void)animation; 133 (void)animation;
134 gdispGSetPowerMode(LED_DISPLAY, powerOff); 134 gdispGSetPowerMode(LED_DISPLAY, powerOff);
135 return false; 135 return false;
136} 136}
137 137
138bool led_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { 138bool led_backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
139 (void)state; 139 (void)state;
140 (void)animation; 140 (void)animation;
141 gdispGSetPowerMode(LED_DISPLAY, powerOn); 141 gdispGSetPowerMode(LED_DISPLAY, powerOn);
diff --git a/quantum/visualizer/led_keyframes.h b/quantum/visualizer/led_backlight_keyframes.h
index a59a4f37d..487151013 100644
--- a/quantum/visualizer/led_keyframes.h
+++ b/quantum/visualizer/led_backlight_keyframes.h
@@ -22,21 +22,21 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE. 22SOFTWARE.
23*/ 23*/
24 24
25#ifndef LED_KEYFRAMES_H 25#ifndef LED_BACKLIGHT_KEYFRAMES_H
26#define LED_KEYFRAMES_H 26#define LED_BACKLIGHT_KEYFRAMES_H
27 27
28#include "visualizer.h" 28#include "visualizer.h"
29 29
30bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state); 30bool led_backlight_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state);
31bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state); 31bool led_backlight_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state);
32bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state); 32bool led_backlight_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
33bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state); 33bool led_backlight_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
34bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state); 34bool led_backlight_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state);
35bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state); 35bool led_backlight_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
36bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state); 36bool led_backlight_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
37 37
38bool led_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state); 38bool led_backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
39bool led_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state); 39bool led_backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
40 40
41extern keyframe_animation_t led_test_animation; 41extern keyframe_animation_t led_test_animation;
42 42
diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk
index 1fe7435d9..a04c9775f 100644
--- a/quantum/visualizer/visualizer.mk
+++ b/quantum/visualizer/visualizer.mk
@@ -43,7 +43,7 @@ OPT_DEFS += -DLCD_BACKLIGHT_ENABLE
43endif 43endif
44 44
45ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) 45ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
46SRC += $(VISUALIZER_DIR)/led_keyframes.c 46SRC += $(VISUALIZER_DIR)/led_backlight_keyframes.c
47endif 47endif
48 48
49include $(GFXLIB)/gfx.mk 49include $(GFXLIB)/gfx.mk