From ddd65e592201b06a7e0e52b8f1d49f0d6a4f89ad Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Wed, 22 Apr 2015 19:21:03 +0900 Subject: [PATCH] Fix backlight bugs for Staryu --- keyboard/staryu/backlight.c | 48 +++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/keyboard/staryu/backlight.c b/keyboard/staryu/backlight.c index 32304a66..8509e713 100644 --- a/keyboard/staryu/backlight.c +++ b/keyboard/staryu/backlight.c @@ -32,11 +32,11 @@ extern backlight_config_t backlight_config; void backlight_set(uint8_t level) { + softpwm_led_enable(); switch (level) { case 1: case 2: case 3: - softpwm_led_enable(); fading_led_disable_all(); breathing_led_disable_all(); softpwm_led_set_all(pgm_read_byte(&backlight_table[level])); @@ -44,20 +44,17 @@ void backlight_set(uint8_t level) case 4: case 5: case 6: - softpwm_led_enable(); breathing_led_enable_all(); fading_led_disable_all(); breathing_led_set_duration(6 - level); break; case 7: - softpwm_led_enable(); fading_led_enable_all(); breathing_led_disable_all(); fading_led_set_direction(FADING_LED_FADE_IN); fading_led_set_duration(3); break; case 8: - softpwm_led_enable(); fading_led_enable_all(); breathing_led_disable_all(); fading_led_set_direction(FADING_LED_FADE_OUT); @@ -67,7 +64,6 @@ void backlight_set(uint8_t level) default: fading_led_disable_all(); breathing_led_disable_all(); - softpwm_led_enable(); break; } } @@ -82,27 +78,6 @@ void softpwm_led_init(void) } void softpwm_led_on(uint8_t index) -{ - switch (index) { - case 0: - PORTC |= (1<