Clarify naming between LCD_BACKLIGHT and LED_BACKLIGHT

This commit is contained in:
Fred Sundvik 2017-07-09 17:46:51 +03:00 committed by Jack Humbert
parent f3c113fb5a
commit 2251560256
9 changed files with 73 additions and 73 deletions

View file

@ -16,7 +16,7 @@
#include "lcd_backlight_keyframes.h"
bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state) {
bool lcd_backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state) {
int frame_length = animation->frame_lengths[animation->current_frame];
int current_pos = frame_length - animation->time_left_in_frame;
uint8_t t_h = LCD_HUE(state->target_lcd_color);
@ -49,7 +49,7 @@ bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualize
return true;
}
bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state) {
bool lcd_backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
state->prev_lcd_color = state->target_lcd_color;
state->current_lcd_color = state->target_lcd_color;
@ -60,14 +60,14 @@ bool backlight_keyframe_set_color(keyframe_animation_t* animation, visualizer_st
return false;
}
bool backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
bool lcd_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) {
bool lcd_backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)animation;
(void)state;
lcd_backlight_color(LCD_HUE(state->current_lcd_color),

View file

@ -1,30 +0,0 @@
/* Copyright 2017 Fred Sundvik
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
#define QUANTUM_VISUALIZER_LCD_BACKLIGHT_KEYFRAMES_H_
#include "visualizer.h"
// Animates the LCD backlight color between the current color and the target color (of the state)
bool backlight_keyframe_animate_color(keyframe_animation_t* animation, visualizer_state_t* state);
// 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_ */

View file

@ -23,7 +23,7 @@ SOFTWARE.
*/
#include "gfx.h"
#include "math.h"
#include "led_keyframes.h"
#include "led_backlight_keyframes.h"
static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) {
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) {
return (uint8_t)(255.0f * v);
}
bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
keyframe_fade_all_leds_from_to(animation, 0, 255);
return true;
}
bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
keyframe_fade_all_leds_from_to(animation, 255, 0);
return true;
}
bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
float frame_length = animation->frame_lengths[animation->current_frame];
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
return true;
}
bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
float frame_length = animation->frame_lengths[animation->current_frame];
float current_pos = frame_length - animation->time_left_in_frame;
@ -98,7 +98,7 @@ static void copy_current_led_state(uint8_t* dest) {
}
}
}
bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
if (animation->first_update_of_frame) {
copy_current_led_state(&crossfade_start_frame[0][0]);
@ -114,28 +114,28 @@ bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t*
return true;
}
bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
(void)animation;
gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180);
return false;
}
bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
(void)animation;
gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0);
return false;
}
bool led_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
(void)animation;
gdispGSetPowerMode(LED_DISPLAY, powerOff);
return false;
}
bool led_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
bool led_backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
(void)state;
(void)animation;
gdispGSetPowerMode(LED_DISPLAY, powerOn);

View file

@ -22,21 +22,21 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#ifndef LED_KEYFRAMES_H
#define LED_KEYFRAMES_H
#ifndef LED_BACKLIGHT_KEYFRAMES_H
#define LED_BACKLIGHT_KEYFRAMES_H
#include "visualizer.h"
bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_backlight_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
extern keyframe_animation_t led_test_animation;

View file

@ -43,7 +43,7 @@ OPT_DEFS += -DLCD_BACKLIGHT_ENABLE
endif
ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
SRC += $(VISUALIZER_DIR)/led_keyframes.c
SRC += $(VISUALIZER_DIR)/led_backlight_keyframes.c
endif
include $(GFXLIB)/gfx.mk