From a916f4e8b897b6b8925d7113d84f9eac7e7b67be Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Jun 2017 14:34:50 +0300 Subject: Let BACKLIGHT_ENABLE control the Infinity LEDs --- keyboards/ergodox/infinity/animations.c | 4 ++-- keyboards/ergodox/infinity/rules.mk | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/animations.c b/keyboards/ergodox/infinity/animations.c index 4c9f6d9c85..0e732b7411 100644 --- a/keyboards/ergodox/infinity/animations.c +++ b/keyboards/ergodox/infinity/animations.c @@ -25,7 +25,7 @@ #include "lcd_backlight_keyframes.h" #endif -#ifdef LED_ENABLE +#ifdef BACKLIGHT_ENABLE #include "led_keyframes.h" #endif @@ -61,7 +61,7 @@ keyframe_animation_t default_suspend_animation = { }; #endif -#if defined(LED_ENABLE) +#if defined(BACKLIGHT_ENABLE) #define CROSSFADE_TIME 1000 #define GRADIENT_TIME 3000 diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk index 9e6170d89a..af29ebce8d 100644 --- a/keyboards/ergodox/infinity/rules.mk +++ b/keyboards/ergodox/infinity/rules.mk @@ -62,15 +62,10 @@ CUSTOM_MATRIX ?= yes # Custom matrix file SERIAL_LINK_ENABLE = yes VISUALIZER_ENABLE ?= yes LCD_ENABLE ?= yes -LED_ENABLE ?= no +BACKLIGHT_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes MIDI_ENABLE = no RGBLIGHT_ENABLE = no -ifdef LCD_ENABLE include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk -endif - -ifdef LED_ENABLE -include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk -endif \ No newline at end of file +include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk \ No newline at end of file -- cgit v1.2.3 From 0f9bfafb9e1fea118a0a61ff2baaff73b05ec157 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Jun 2017 15:31:02 +0300 Subject: Turn off LED matrix by default --- .../ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c index ea09c4bb0c..2472694466 100644 --- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c @@ -173,7 +173,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { } // software shutdown disable (i.e. turn stuff on) - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); gfxSleepMilliseconds(10); // Finish Init @@ -183,7 +183,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { g->g.Width = GDISP_SCREEN_WIDTH; g->g.Height = GDISP_SCREEN_HEIGHT; g->g.Orientation = GDISP_ROTATE_0; - g->g.Powermode = powerOn; + g->g.Powermode = powerOff; g->g.Backlight = GDISP_INITIAL_BACKLIGHT; g->g.Contrast = GDISP_INITIAL_CONTRAST; return TRUE; -- cgit v1.2.3 From 2a7f9a7e46e1f4350be249c267fa7c35fd6562b5 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Jun 2017 21:30:52 +0300 Subject: Add backlight control to the IS31FL3731 driver --- .../infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c index 2472694466..0b48783d6a 100644 --- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c @@ -43,7 +43,7 @@ extern const uint8_t CIE1931_CURVE[]; #define GDISP_INITIAL_CONTRAST 0 #endif #ifndef GDISP_INITIAL_BACKLIGHT - #define GDISP_INITIAL_BACKLIGHT 100 + #define GDISP_INITIAL_BACKLIGHT 0 #endif #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) @@ -204,7 +204,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { uint8_t* src = PRIV(g)->frame_buffer; for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[*src]; + uint8_t val = (uint16_t)*src * g->g.Backlight / 100; + PRIV(g)->write_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[val]; ++src; } } @@ -297,8 +298,13 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { g->g.Orientation = (orientation_t)g->p.ptr; return; - case GDISP_CONTROL_CONTRAST: - return; + case GDISP_CONTROL_BACKLIGHT: + if (g->g.Backlight == (unsigned)g->p.ptr) + return; + unsigned val = (unsigned)g->p.ptr; + g->g.Backlight = val > 255 ? 255 : val; + g->flags |= GDISP_FLG_NEEDFLUSH; + return; } } #endif // GDISP_NEED_CONTROL -- cgit v1.2.3 From b51a0db6ed03d939baad7cb9d87ed13c3653c7d2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Jun 2017 22:04:10 +0300 Subject: Add backlight support to the default Ergodox Infinity animations --- keyboards/ergodox/infinity/animations.c | 69 +++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 11 deletions(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/animations.c b/keyboards/ergodox/infinity/animations.c index 0e732b7411..675519e309 100644 --- a/keyboards/ergodox/infinity/animations.c +++ b/keyboards/ergodox/infinity/animations.c @@ -32,31 +32,78 @@ #include "visualizer_keyframes.h" -#if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE) +#if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE) + +static bool keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) { +#ifdef LCD_ENABLE + lcd_keyframe_enable(animation, state); +#endif +#ifdef LCD_BACKLIGHT_ENABLE + backlight_keyframe_enable(animation, state); +#endif +#ifdef BACKLIGHT_ENABLE + led_keyframe_enable(animation, state); +#endif + return false; +} + +static bool keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) { +#ifdef LCD_ENABLE + lcd_keyframe_disable(animation, state); +#endif +#ifdef LCD_BACKLIGHT_ENABLE + backlight_keyframe_disable(animation, state); +#endif +#ifdef BACKLIGHT_ENABLE + led_keyframe_disable(animation, state); +#endif + return false; +} + +static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t* state) { + bool ret = false; +#ifdef LCD_BACKLIGHT_ENABLE + ret |= backlight_keyframe_animate_color(animation, state); +#endif +#ifdef BACLIGHT_ENABLE + ret |= led_keyframe_fade_in_all(animation, state); +#endif + return ret; +} + +static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_t* state) { + bool ret = false; +#ifdef LCD_BACKLIGHT_ENABLE + ret |= backlight_keyframe_animate_color(animation, state); +#endif +#ifdef BACLIGHT_ENABLE + ret |= led_keyframe_fade_out_all(animation, state); +#endif + return ret; +} + // Don't worry, if the startup animation is long, you can use the keyboard like normal // during that time keyframe_animation_t default_startup_animation = { - .num_frames = 4, + .num_frames = 3, .loop = false, - .frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0}, + .frame_lengths = {0, 0, gfxMillisecondsToTicks(5000)}, .frame_functions = { - lcd_keyframe_enable, - backlight_keyframe_enable, + keyframe_enable, lcd_keyframe_draw_logo, - backlight_keyframe_animate_color, + keyframe_fade_in, }, }; keyframe_animation_t default_suspend_animation = { - .num_frames = 4, + .num_frames = 3, .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0}, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, .frame_functions = { lcd_keyframe_display_layer_text, - backlight_keyframe_animate_color, - lcd_keyframe_disable, - backlight_keyframe_disable, + keyframe_fade_out, + keyframe_disable, }, }; #endif -- cgit v1.2.3 From 19f0285a766e412db14e6cbe24532fdbff610af0 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 15 Jun 2017 23:21:01 +0300 Subject: Fix typo in BACKLIGHT_ENABLE --- keyboards/ergodox/infinity/animations.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/animations.c b/keyboards/ergodox/infinity/animations.c index 675519e309..ebc08fde36 100644 --- a/keyboards/ergodox/infinity/animations.c +++ b/keyboards/ergodox/infinity/animations.c @@ -65,7 +65,7 @@ static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t #ifdef LCD_BACKLIGHT_ENABLE ret |= backlight_keyframe_animate_color(animation, state); #endif -#ifdef BACLIGHT_ENABLE +#ifdef BACKLIGHT_ENABLE ret |= led_keyframe_fade_in_all(animation, state); #endif return ret; @@ -76,7 +76,7 @@ static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_ #ifdef LCD_BACKLIGHT_ENABLE ret |= backlight_keyframe_animate_color(animation, state); #endif -#ifdef BACLIGHT_ENABLE +#ifdef BACKLIGHT_ENABLE ret |= led_keyframe_fade_out_all(animation, state); #endif return ret; -- cgit v1.2.3 From 086aad0d7e5770e0be36498e5f569af5a23b111c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 16 Jun 2017 02:06:30 +0300 Subject: Make sure backlight is in the range 0-100 --- .../ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c index 0b48783d6a..b4a5c84b0a 100644 --- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c @@ -302,7 +302,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { if (g->g.Backlight == (unsigned)g->p.ptr) return; unsigned val = (unsigned)g->p.ptr; - g->g.Backlight = val > 255 ? 255 : val; + g->g.Backlight = val > 100 ? 100 : val; g->flags |= GDISP_FLG_NEEDFLUSH; return; } -- cgit v1.2.3 From 574ca7f59ce7b3408aa848f782adac5e3a2f4fb6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 22 Apr 2017 12:48:56 +0300 Subject: Delete emulator drivers --- .../ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk | 2 -- .../ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 ---------- .../ergodox/infinity/drivers/gdisp/emulator_led/driver.mk | 2 -- .../ergodox/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 (limited to 'keyboards/ergodox/infinity') 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 16c3f80f53..0000000000 --- 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 babfe2b367..0000000000 --- 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 2554344321..0000000000 --- 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 b0ebcdc475..0000000000 --- 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" -- 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 --- keyboards/ergodox/infinity/visualizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c index a4b09a34d0..5b6b320074 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); } -- cgit v1.2.3 From 42e6ecc36b65ad0f0d29c6c35c93b95078c11a1a Mon Sep 17 00:00:00 2001 From: Ethan Madden Date: Sun, 25 Jun 2017 18:30:40 -0700 Subject: Whitefox LED control (#1432) * use new grave_esc functionality * Port LED control from Ergodox Infinity to Whitefox --- keyboards/ergodox/infinity/config.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/config.h b/keyboards/ergodox/infinity/config.h index 95f713819e..25cc8af0fc 100644 --- a/keyboards/ergodox/infinity/config.h +++ b/keyboards/ergodox/infinity/config.h @@ -56,6 +56,11 @@ along with this program. If not, see . #define VISUALIZER_USER_DATA_SIZE 16 +#define LCD_DISPLAY_NUMBER 0 +#define LED_DISPLAY_NUMBER 1 + +#define LED_NUM_ROWS 7 +#define LED_NUM_COLS 7 /* * Feature disable options * These options are also useful to firmware size reduction. -- cgit v1.2.3 From b476d65b9cc2b25031c6f8143fd6a59a7d5ee6b7 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 30 Jun 2017 16:09:52 -0400 Subject: Update keyboards' rules.mk/Makefiles (#1442) this may change some of the keyboards' default settings - if you experience anything odd, please check back to this commit --- keyboards/ergodox/infinity/rules.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'keyboards/ergodox/infinity') diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk index af29ebce8d..bbb0f6efea 100644 --- a/keyboards/ergodox/infinity/rules.mk +++ b/keyboards/ergodox/infinity/rules.mk @@ -58,12 +58,12 @@ OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 # Build Options # comment out to disable the options. # -CUSTOM_MATRIX ?= yes # Custom matrix file +CUSTOM_MATRIX = yes # Custom matrix file SERIAL_LINK_ENABLE = yes -VISUALIZER_ENABLE ?= yes -LCD_ENABLE ?= yes -BACKLIGHT_ENABLE ?= yes -LCD_BACKLIGHT_ENABLE ?= yes +VISUALIZER_ENABLE = yes +LCD_ENABLE = yes +BACKLIGHT_ENABLE = yes +LCD_BACKLIGHT_ENABLE = yes MIDI_ENABLE = no RGBLIGHT_ENABLE = no -- cgit v1.2.3