From: Jan "Yenya" Kasprzak Date: Tue, 25 Jun 2013 20:16:47 +0000 (+0200) Subject: pwmled.c: reload ADC target data after setting the brightness X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=d7b30b8a6cd8a3de2207c5e6204f762611f17edb;p=bike-lights.git pwmled.c: reload ADC target data after setting the brightness --- diff --git a/firmware/pwmled.c b/firmware/pwmled.c index b8f702a..bf376ee 100644 --- a/firmware/pwmled.c +++ b/firmware/pwmled.c @@ -138,8 +138,10 @@ void pwmled_set_brightness(uint16_t brightness) adc_vals[7] = adc_targets_2[(brightness >> 12) & 0x7]; adc_vals[8] = adc_vals[7]; - for (i = 0; i < N_PWMLEDS; i++) + for (i = 0; i < N_PWMLEDS; i++) { pwmleds[i].err_sum = 0; + pwmled_set_mode(i, pwmleds[i].mode); + } } #define PWMLED_PROBE_STEADY_COUNT 10