From 6c9b4743f766cffe0f382d39591219543dc92d48 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 15 Apr 2017 12:35:55 +0300 Subject: Include config.h before visualizer.h --- quantum/visualizer/visualizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/visualizer') diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index 486ff25b3..a4b3ea7e4 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "visualizer.h" #include "config.h" +#include "visualizer.h" #include #ifdef PROTOCOL_CHIBIOS #include "ch.h" -- cgit v1.2.3 From ff49259a1a965f13761d8f1dda4813a2aa87d718 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 15 Apr 2017 14:24:26 +0300 Subject: Include config.h from visualizer.h --- quantum/visualizer/visualizer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/visualizer') diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 1c567440f..90ecdcbae 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -28,6 +28,7 @@ SOFTWARE. #include #include +#include "config.h" #include "gfx.h" #ifdef LCD_BACKLIGHT_ENABLE -- cgit v1.2.3 From da19852964e5c1a03b505bcbc7e063fbd8a63fa9 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 22 Apr 2017 12:47:45 +0300 Subject: Add function for getting the LCD backlight brightness --- quantum/visualizer/lcd_backlight.c | 4 ++++ quantum/visualizer/lcd_backlight.h | 1 + 2 files changed, 5 insertions(+) (limited to 'quantum/visualizer') diff --git a/quantum/visualizer/lcd_backlight.c b/quantum/visualizer/lcd_backlight.c index 00de3fab5..6cd996f75 100644 --- a/quantum/visualizer/lcd_backlight.c +++ b/quantum/visualizer/lcd_backlight.c @@ -83,3 +83,7 @@ void lcd_backlight_brightness(uint8_t b) { current_brightness = b; lcd_backlight_color(current_hue, current_saturation, current_intensity); } + +uint8_t lcd_get_backlight_brightness(void) { + return current_brightness; +} diff --git a/quantum/visualizer/lcd_backlight.h b/quantum/visualizer/lcd_backlight.h index 14dde64a1..172e9bac5 100644 --- a/quantum/visualizer/lcd_backlight.h +++ b/quantum/visualizer/lcd_backlight.h @@ -39,6 +39,7 @@ inline uint32_t change_lcd_color_intensity(uint32_t color, uint8_t new_intensity void lcd_backlight_init(void); void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity); void lcd_backlight_brightness(uint8_t b); +uint8_t lcd_get_backlight_brightness(void); void lcd_backlight_hal_init(void); void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b); -- cgit v1.2.3 From f912c74fe7a4a7108e8966ebe4802eae92739dd1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 22 Apr 2017 19:49:41 +0300 Subject: Change inline to static inline --- quantum/visualizer/lcd_backlight.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/visualizer') diff --git a/quantum/visualizer/lcd_backlight.h b/quantum/visualizer/lcd_backlight.h index 172e9bac5..95d7a07b4 100644 --- a/quantum/visualizer/lcd_backlight.h +++ b/quantum/visualizer/lcd_backlight.h @@ -32,7 +32,7 @@ SOFTWARE. #define LCD_SAT(color) ((color >> 8) & 0xFF) #define LCD_INT(color) (color & 0xFF) -inline uint32_t change_lcd_color_intensity(uint32_t color, uint8_t new_intensity) { +static inline uint32_t change_lcd_color_intensity(uint32_t color, uint8_t new_intensity) { return (color & 0xFFFFFF00) | new_intensity; } -- cgit v1.2.3 From 1e6a3f9e170759dd88ba29f67d35d9c34b3f8f8c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 25 Jun 2017 12:55:18 +0300 Subject: Change M_2_PI to 2 * PI as it should be --- quantum/visualizer/led_keyframes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/visualizer') diff --git a/quantum/visualizer/led_keyframes.c b/quantum/visualizer/led_keyframes.c index c14491e5e..2f4e20043 100644 --- a/quantum/visualizer/led_keyframes.c +++ b/quantum/visualizer/led_keyframes.c @@ -48,7 +48,7 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; static uint8_t compute_gradient_color(float t, float index, float num) { - const float two_pi = M_2_PI; + const float two_pi = M_PI * 2.0f; float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi; float x = t * two_pi + normalized_index; float v = 0.5 * (cosf(x) + 1.0f); -- cgit v1.2.3