diff options
Diffstat (limited to 'quantum/visualizer')
-rw-r--r-- | quantum/visualizer/lcd_backlight.c | 4 | ||||
-rw-r--r-- | quantum/visualizer/lcd_backlight.h | 3 | ||||
-rw-r--r-- | quantum/visualizer/led_keyframes.c | 2 | ||||
-rw-r--r-- | quantum/visualizer/visualizer.c | 2 | ||||
-rw-r--r-- | quantum/visualizer/visualizer.h | 1 |
5 files changed, 9 insertions, 3 deletions
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..95d7a07b4 100644 --- a/quantum/visualizer/lcd_backlight.h +++ b/quantum/visualizer/lcd_backlight.h @@ -32,13 +32,14 @@ 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; } 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); 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); 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 <string.h> #ifdef PROTOCOL_CHIBIOS #include "ch.h" 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 <stdint.h> #include <stdbool.h> +#include "config.h" #include "gfx.h" #ifdef LCD_BACKLIGHT_ENABLE |