From 6c9b4743f766cffe0f382d39591219543dc92d48 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 15 Apr 2017 12:35:55 +0300 Subject: [PATCH 1/8] Include config.h before visualizer.h --- quantum/visualizer/visualizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From b0094e631ee9d4b145e69b6cacd2535e27850ea6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 15 Apr 2017 12:59:14 +0300 Subject: [PATCH 2/8] Change remote url of uGFX to relative path --- lib/ugfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ugfx b/lib/ugfx index 3e97b74e0..d108287cb 160000 --- a/lib/ugfx +++ b/lib/ugfx @@ -1 +1 @@ -Subproject commit 3e97b74e03c93631cdd3ddb2ce43b963fdce19b2 +Subproject commit d108287cb10c3ec1c8e402b484e93c52b8cd7113 From ff49259a1a965f13761d8f1dda4813a2aa87d718 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 15 Apr 2017 14:24:26 +0300 Subject: [PATCH 3/8] Include config.h from visualizer.h --- quantum/visualizer/visualizer.h | 1 + 1 file changed, 1 insertion(+) 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 From da19852964e5c1a03b505bcbc7e063fbd8a63fa9 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 22 Apr 2017 12:47:45 +0300 Subject: [PATCH 4/8] 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(+) 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); From 574ca7f59ce7b3408aa848f782adac5e3a2f4fb6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 22 Apr 2017 12:48:56 +0300 Subject: [PATCH 5/8] Delete emulator drivers --- .../infinity/drivers/gdisp/emulator_lcd/driver.mk | 2 -- .../infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 ---------- .../infinity/drivers/gdisp/emulator_led/driver.mk | 2 -- .../infinity/drivers/gdisp/emulator_led/emulator_led.c | 10 ---------- 4 files changed, 24 deletions(-) delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk deleted file mode 100644 index 16c3f80f5..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_lcd -GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c deleted file mode 100644 index babfe2b36..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 128 -#define GDISP_SCREEN_HEIGHT 32 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk deleted file mode 100644 index 255434432..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_led -GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c deleted file mode 100644 index b0ebcdc47..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 7 -#define GDISP_SCREEN_HEIGHT 7 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" From f912c74fe7a4a7108e8966ebe4802eae92739dd1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 22 Apr 2017 19:49:41 +0300 Subject: [PATCH 6/8] Change inline to static inline --- keyboards/ergodox/infinity/visualizer.c | 2 +- quantum/visualizer/lcd_backlight.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c index a4b09a34d..5b6b32007 100644 --- a/keyboards/ergodox/infinity/visualizer.c +++ b/keyboards/ergodox/infinity/visualizer.c @@ -123,7 +123,7 @@ void initialize_user_visualizer(visualizer_state_t* state) { start_keyframe_animation(&default_startup_animation); } -inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) { +static inline bool is_led_on(visualizer_user_data_t* user_data, uint8_t num) { return user_data->led_on & (1u << num); } 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; } From dcf9fa1aaad50fa5dc920407e9148f1192e76705 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 24 Jun 2017 00:37:27 +0300 Subject: [PATCH 7/8] Update the ugfx submodule --- lib/ugfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ugfx b/lib/ugfx index d108287cb..3e97b74e0 160000 --- a/lib/ugfx +++ b/lib/ugfx @@ -1 +1 @@ -Subproject commit d108287cb10c3ec1c8e402b484e93c52b8cd7113 +Subproject commit 3e97b74e03c93631cdd3ddb2ce43b963fdce19b2 From 1e6a3f9e170759dd88ba29f67d35d9c34b3f8f8c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 25 Jun 2017 12:55:18 +0300 Subject: [PATCH 8/8] Change M_2_PI to 2 * PI as it should be --- quantum/visualizer/led_keyframes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);