summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-06-25 10:29:00 -0400
committerGitHub <noreply@github.com>2017-06-25 10:29:00 -0400
commitde833659ae0408be6774ff10ebfcbf98fe0e10f1 (patch)
treebae192f0e883b4994d6d09766006029c58871eca /quantum
parent62c77e7dbf0ac6d52448886bc6e1fda7551f94f5 (diff)
parent1e6a3f9e170759dd88ba29f67d35d9c34b3f8f8c (diff)
Merge pull request #1429 from fredizzimo/fixes_for_emulator
Minor fixes to support the emulator
Diffstat (limited to 'quantum')
-rw-r--r--quantum/visualizer/lcd_backlight.c4
-rw-r--r--quantum/visualizer/lcd_backlight.h3
-rw-r--r--quantum/visualizer/led_keyframes.c2
-rw-r--r--quantum/visualizer/visualizer.c2
-rw-r--r--quantum/visualizer/visualizer.h1
5 files changed, 9 insertions, 3 deletions
diff --git a/quantum/visualizer/lcd_backlight.c b/quantum/visualizer/lcd_backlight.c
index 00de3fab52..6cd996f75e 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 14dde64a1a..95d7a07b46 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 c14491e5e1..2f4e200439 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 486ff25b3f..a4b3ea7e49 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 1c567440fb..90ecdcbaea 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