From fcbddae2cc187fbf586228252b0591552b026493 Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Thu, 28 Aug 2014 09:59:53 +0900 Subject: [PATCH] Implement backlight scheme of TentaPad --- common/softpwm_led.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/common/softpwm_led.c b/common/softpwm_led.c index b8751fb5..1c072bb0 100644 --- a/common/softpwm_led.c +++ b/common/softpwm_led.c @@ -253,15 +253,13 @@ ISR(TIMER1_COMPA_vect) { static uint8_t pwm = 0; pwm++; - // LED on - if (pwm == 0) { - for (uint8_t i = 0; i < LED_COUNT; i++) { + for (uint8_t i = 0; i < LED_COUNT; i++) { + // LED on + if (pwm == 0) { softpwm_led_on(i); softpwm_led_ocr[i] = softpwm_led_ocr_buff[i]; } - } - // LED off - for (uint8_t i = 0; i < LED_COUNT; i++) { + // LED off if (pwm == softpwm_led_ocr[i]) { softpwm_led_off(i); }