diff --git a/keyboard/fantastic60/backlight.c b/keyboard/fantastic60/backlight.c index bbc14bf1..0bf951a8 100755 --- a/keyboard/fantastic60/backlight.c +++ b/keyboard/fantastic60/backlight.c @@ -47,6 +47,7 @@ void backlight_set(uint8_t level) breathing_led_disable(BACKLIGHT); backlight_brightness = pgm_read_byte(&backlight_table[level]); softpwm_led_set(BACKLIGHT, backlight_brightness); + rgb_set_brightness(backlight_brightness); break; case 4: case 5: @@ -63,11 +64,13 @@ void backlight_set(uint8_t level) breathing_led_disable(BACKLIGHT); fading_led_set_direction(BACKLIGHT, FADING_LED_FADE_IN); fading_led_set_duration(3); + break; case 8: fading_led_enable(BACKLIGHT); breathing_led_disable(BACKLIGHT); fading_led_set_direction(BACKLIGHT, FADING_LED_FADE_OUT); fading_led_set_duration(3); + break; #endif case 0: default: @@ -105,7 +108,12 @@ void softpwm_led_init() void softpwm_led_on(uint8_t index) { - PORTF &= ~((1<> index); + if (index) { + PORTF &= ~((1<> index); + } + else { + PORTF |= (1<> index); + if (index) { + PORTF |= ((1<> index); + } + else { + PORTF &= ~(1<= 240) { - *c = 255; + if (rgb_config.level == RGB_FIXED) { + uint8_t *c = &rgb_color.raw[color]; + if (*c >= 240) { + *c = 255; + } + else { + *c += 16; + } + rgb_refresh(&rgb_color); + rgb_write_color(); } - else { - *c += 16; - } - rgb_refresh(&rgb_color); - rgb_write_color(); } void rgb_color_decrease(uint8_t color) { - uint8_t *c = &rgb_color.raw[color]; - if (*c > 240) { - *c = 240; + if (rgb_config.level == RGB_FIXED) { + uint8_t *c = &rgb_color.raw[color]; + if (*c > 240) { + *c = 240; + } + else if (*c < 16) { + *c = 0; + } + else { + *c -= 16; + } + rgb_refresh(&rgb_color); + rgb_write_color(); } - else if (*c < 16) { - *c = 0; - } - else { - *c -= 16; - } - rgb_refresh(&rgb_color); - rgb_write_color(); } void rgb_set_level(uint8_t level)