From: Jan "Yenya" Kasprzak Date: Wed, 21 Nov 2012 22:06:04 +0000 (+0100) Subject: adc: only 4 measurements for single-ended pwm X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=fb8d751d7d12d162e6d755bf1f39fec26629d304;p=bike-lights.git adc: only 4 measurements for single-ended pwm --- diff --git a/firmware/adc.c b/firmware/adc.c index 8bc171a..38f3677 100644 --- a/firmware/adc.c +++ b/firmware/adc.c @@ -28,7 +28,7 @@ static void inline setup_mux(unsigned char n) break; case 2: // pwmled 3: 1.1V, ADC4 (PA5), single-ended ADMUX = _BV(REFS1) | _BV(MUX2); - sum_shift = 3; // 8 measurements + sum_shift = 2; // 4 measurements break; case 3: // ambient light: 1.1V, ADC5 (PA6), single-ended ADMUX = _BV(REFS1) | _BV(MUX2) | _BV(MUX0);