From: Jan "Yenya" Kasprzak Date: Tue, 25 Jun 2013 20:17:45 +0000 (+0200) Subject: pwmled: faster regulation X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=2619e6489323947c22ac8aa724837875b5a4ddea;p=bike-lights.git pwmled: faster regulation --- diff --git a/firmware/pwmled.c b/firmware/pwmled.c index bf376ee..3456e95 100644 --- a/firmware/pwmled.c +++ b/firmware/pwmled.c @@ -225,7 +225,8 @@ void pwmled_adc(unsigned char n, uint16_t adcval) old_pwm = led->pwm; - shift = led->state == ST_PROBING ? 3 : 8; + // shift = led->state == ST_PROBING ? 3 : 8; + shift = 3; sum = ((int32_t)led->pwm << shift) + led->err_sum + led->target - adcval;