diff options
author | Fred Sundvik <fsundvik@gmail.com> | 2017-04-05 09:21:18 +0300 |
---|---|---|
committer | Fred Sundvik <fsundvik@gmail.com> | 2017-04-09 18:34:59 +0300 |
commit | 1e7585e76771e1a2d8ca733fc09c19f9fa0e903c (patch) | |
tree | e4e5ebff65cd1f60fe4ecdd71501c05bff9b6b24 /quantum/visualizer | |
parent | 5ba228b684a32c1099efc6207842a56ff102961a (diff) | |
download | qmk_firmware-1e7585e76771e1a2d8ca733fc09c19f9fa0e903c.tar.gz qmk_firmware-1e7585e76771e1a2d8ca733fc09c19f9fa0e903c.zip |
Separated backlight and LCD disable/enable
Also moved them to correct places
Diffstat (limited to 'quantum/visualizer')
-rw-r--r-- | quantum/visualizer/lcd_backlight_keyframes.c | 16 | ||||
-rw-r--r-- | quantum/visualizer/lcd_backlight_keyframes.h | 3 | ||||
-rw-r--r-- | quantum/visualizer/lcd_keyframes.c | 14 | ||||
-rw-r--r-- | quantum/visualizer/lcd_keyframes.h | 4 | ||||
-rw-r--r-- | quantum/visualizer/visualizer.c | 21 | ||||
-rw-r--r-- | quantum/visualizer/visualizer.h | 3 |
6 files changed, 37 insertions, 24 deletions
diff --git a/quantum/visualizer/lcd_backlight_keyframes.c b/quantum/visualizer/lcd_backlight_keyframes.c index 096473708..8436d4e3d 100644 --- a/quantum/visualizer/lcd_backlight_keyframes.c +++ b/quantum/visualizer/lcd_backlight_keyframes.c | |||
@@ -59,3 +59,19 @@ bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_st | |||
59 | LCD_INT(state->current_lcd_color)); | 59 | LCD_INT(state->current_lcd_color)); |
60 | return false; | 60 | return false; |
61 | } | 61 | } |
62 | |||
63 | bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
64 | (void)animation; | ||
65 | (void)state; | ||
66 | lcd_backlight_hal_color(0, 0, 0); | ||
67 | return false; | ||
68 | } | ||
69 | |||
70 | bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
71 | (void)animation; | ||
72 | (void)state; | ||
73 | lcd_backlight_color(LCD_HUE(state->current_lcd_color), | ||
74 | LCD_SAT(state->current_lcd_color), | ||
75 | LCD_INT(state->current_lcd_color)); | ||
76 | return false; | ||
77 | } | ||
diff --git a/quantum/visualizer/lcd_backlight_keyframes.h b/quantum/visualizer/lcd_backlight_keyframes.h index 8cd5a46c6..e1c125cf9 100644 --- a/quantum/visualizer/lcd_backlight_keyframes.h +++ b/quantum/visualizer/lcd_backlight_keyframes.h | |||
@@ -24,4 +24,7 @@ bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualize | |||
24 | // Sets the backlight color to the target color | 24 | // Sets the backlight color to the target color |
25 | bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state); | 25 | bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state); |
26 | 26 | ||
27 | bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state); | ||
28 | bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state); | ||
29 | |||
27 | #endif /* QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_ */ | 30 | #endif /* QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_ */ |
diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c index 00d9734e6..74f6e3b47 100644 --- a/quantum/visualizer/lcd_keyframes.c +++ b/quantum/visualizer/lcd_keyframes.c | |||
@@ -158,3 +158,17 @@ bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, | |||
158 | gdispFlush(); | 158 | gdispFlush(); |
159 | return false; | 159 | return false; |
160 | } | 160 | } |
161 | |||
162 | bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
163 | (void)animation; | ||
164 | (void)state; | ||
165 | gdispSetPowerMode(powerOff); | ||
166 | return false; | ||
167 | } | ||
168 | |||
169 | bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
170 | (void)animation; | ||
171 | (void)state; | ||
172 | gdispSetPowerMode(powerOn); | ||
173 | return false; | ||
174 | } | ||
diff --git a/quantum/visualizer/lcd_keyframes.h b/quantum/visualizer/lcd_keyframes.h index 0c9f39ab8..8f79a541c 100644 --- a/quantum/visualizer/lcd_keyframes.h +++ b/quantum/visualizer/lcd_keyframes.h | |||
@@ -30,4 +30,8 @@ bool lcd_keyframe_display_led_states(keyframe_animation_t* animation, visualizer | |||
30 | // Displays both the layer text and the led states | 30 | // Displays both the layer text and the led states |
31 | bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state); | 31 | bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state); |
32 | 32 | ||
33 | bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state); | ||
34 | bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state); | ||
35 | |||
36 | |||
33 | #endif /* QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_ */ | 37 | #endif /* QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_ */ |
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index 6ebd806e4..98cd7ba55 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c | |||
@@ -228,27 +228,6 @@ bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* | |||
228 | return false; | 228 | return false; |
229 | } | 229 | } |
230 | 230 | ||
231 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
232 | (void)animation; | ||
233 | (void)state; | ||
234 | #ifdef LCD_ENABLE | ||
235 | gdispSetPowerMode(powerOff); | ||
236 | #endif | ||
237 | #ifdef LCD_BACKLIGHT_ENABLE | ||
238 | lcd_backlight_hal_color(0, 0, 0); | ||
239 | #endif | ||
240 | return false; | ||
241 | } | ||
242 | |||
243 | bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { | ||
244 | (void)animation; | ||
245 | (void)state; | ||
246 | #ifdef LCD_ENABLE | ||
247 | gdispSetPowerMode(powerOn); | ||
248 | #endif | ||
249 | return false; | ||
250 | } | ||
251 | |||
252 | bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state) { | 231 | bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state) { |
253 | (void)animation; | 232 | (void)animation; |
254 | (void)state; | 233 | (void)state; |
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 5c870dbfe..f37ce8416 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 | |||
130 | // Does nothing, useful for adding delays | 130 | // Does nothing, useful for adding delays |
131 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); | 131 | bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); |
132 | 132 | ||
133 | bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); | ||
134 | bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); | ||
135 | |||
136 | // Call this once, when the initial animation has finished, alternatively you can call it | 133 | // Call this once, when the initial animation has finished, alternatively you can call it |
137 | // directly from the initalize_user_visualizer function (the animation can be null) | 134 | // directly from the initalize_user_visualizer function (the animation can be null) |
138 | bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); | 135 | bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); |