summaryrefslogtreecommitdiff
path: root/quantum/visualizer
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2017-04-05 09:21:18 +0300
committerFred Sundvik <fsundvik@gmail.com>2017-04-09 18:34:59 +0300
commit1e7585e76771e1a2d8ca733fc09c19f9fa0e903c (patch)
treee4e5ebff65cd1f60fe4ecdd71501c05bff9b6b24 /quantum/visualizer
parent5ba228b684a32c1099efc6207842a56ff102961a (diff)
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.c16
-rw-r--r--quantum/visualizer/lcd_backlight_keyframes.h3
-rw-r--r--quantum/visualizer/lcd_keyframes.c14
-rw-r--r--quantum/visualizer/lcd_keyframes.h4
-rw-r--r--quantum/visualizer/visualizer.c21
-rw-r--r--quantum/visualizer/visualizer.h3
6 files changed, 37 insertions, 24 deletions
diff --git a/quantum/visualizer/lcd_backlight_keyframes.c b/quantum/visualizer/lcd_backlight_keyframes.c
index 0964737087..8436d4e3dd 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
LCD_INT(state->current_lcd_color));
return false;
}
+
+bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)animation;
+ (void)state;
+ lcd_backlight_hal_color(0, 0, 0);
+ return false;
+}
+
+bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)animation;
+ (void)state;
+ lcd_backlight_color(LCD_HUE(state->current_lcd_color),
+ LCD_SAT(state->current_lcd_color),
+ LCD_INT(state->current_lcd_color));
+ return false;
+}
diff --git a/quantum/visualizer/lcd_backlight_keyframes.h b/quantum/visualizer/lcd_backlight_keyframes.h
index 8cd5a46c6a..e1c125cf91 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
// Sets the backlight color to the target color
bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state);
+bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
+bool backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
+
#endif /* QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_ */
diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c
index 00d9734e6a..74f6e3b470 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,
gdispFlush();
return false;
}
+
+bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)animation;
+ (void)state;
+ gdispSetPowerMode(powerOff);
+ return false;
+}
+
+bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)animation;
+ (void)state;
+ gdispSetPowerMode(powerOn);
+ return false;
+}
diff --git a/quantum/visualizer/lcd_keyframes.h b/quantum/visualizer/lcd_keyframes.h
index 0c9f39ab8c..8f79a541c8 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
// Displays both the layer text and the led states
bool lcd_keyframe_display_layer_and_led_states(keyframe_animation_t* animation, visualizer_state_t* state);
+bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
+bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
+
+
#endif /* QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_ */
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c
index 6ebd806e40..98cd7ba554 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*
return false;
}
-bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
- (void)animation;
- (void)state;
-#ifdef LCD_ENABLE
- gdispSetPowerMode(powerOff);
-#endif
-#ifdef LCD_BACKLIGHT_ENABLE
- lcd_backlight_hal_color(0, 0, 0);
-#endif
- return false;
-}
-
-bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) {
- (void)animation;
- (void)state;
-#ifdef LCD_ENABLE
- gdispSetPowerMode(powerOn);
-#endif
- return false;
-}
-
bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
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);