aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ergodox/infinity/infinity.c6
-rw-r--r--keyboards/ergodox/infinity/led.c25
2 files changed, 5 insertions, 26 deletions
diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c
index c5793385f..02db67eaf 100644
--- a/keyboards/ergodox/infinity/infinity.c
+++ b/keyboards/ergodox/infinity/infinity.c
@@ -38,7 +38,6 @@ void init_serial_link_hal(void) {
38// Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced 38// Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced
39// Which will reduce the brightness range 39// Which will reduce the brightness range
40#define PRESCALAR_DEFINE 0 40#define PRESCALAR_DEFINE 0
41#ifdef VISUALIZER_ENABLE
42void lcd_backlight_hal_init(void) { 41void lcd_backlight_hal_init(void) {
43 // Setup Backlight 42 // Setup Backlight
44 SIM->SCGC6 |= SIM_SCGC6_FTM0; 43 SIM->SCGC6 |= SIM_SCGC6_FTM0;
@@ -76,7 +75,6 @@ void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
76 CHANNEL_GREEN.CnV = g; 75 CHANNEL_GREEN.CnV = g;
77 CHANNEL_BLUE.CnV = b; 76 CHANNEL_BLUE.CnV = b;
78} 77}
79#endif
80 78
81__attribute__ ((weak)) 79__attribute__ ((weak))
82void matrix_init_user(void) { 80void matrix_init_user(void) {
@@ -92,6 +90,10 @@ void matrix_init_kb(void) {
92 // runs once when the firmware starts up 90 // runs once when the firmware starts up
93 91
94 matrix_init_user(); 92 matrix_init_user();
93 // The backlight always has to be initialized, otherwise it will stay lit
94#ifndef VISUALIZER_ENABLE
95 lcd_backlight_hal_init();
96#endif
95} 97}
96 98
97void matrix_scan_kb(void) { 99void matrix_scan_kb(void) {
diff --git a/keyboards/ergodox/infinity/led.c b/keyboards/ergodox/infinity/led.c
index 77195bb35..8175c1c5c 100644
--- a/keyboards/ergodox/infinity/led.c
+++ b/keyboards/ergodox/infinity/led.c
@@ -21,29 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22 22
23void led_set(uint8_t usb_led) { 23void led_set(uint8_t usb_led) {
24// The LCD backlight functionality conflicts with this simple 24 //TODO: Add led emulation if there's no customized visualization
25// red backlight
26#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE)
27 // PTC1: LCD Backlight Red(0:on/1:off)
28 GPIOC->PDDR |= (1<<1);
29 PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
30 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
31 GPIOC->PCOR |= (1<<1);
32 } else {
33 GPIOC->PSOR |= (1<<1);
34 }
35#elif !defined(LCD_BACKLIGHT_ENABLE)
36 (void)usb_led; 25 (void)usb_led;
37 GPIOC->PDDR |= (1<<1);
38 PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
39 GPIOC->PSOR |= (1<<1);
40 GPIOC->PDDR |= (1<<2);
41 PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
42 GPIOC->PSOR |= (1<<2);
43 GPIOC->PDDR |= (1<<3);
44 PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
45 GPIOC->PSOR |= (1<<3);
46#else
47 (void)usb_led;
48#endif
49} 26}