]> www.fi.muni.cz Git - bike-lights.git/commitdiff
adc: only 4 measurements for single-ended pwm
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 21 Nov 2012 22:06:04 +0000 (23:06 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Wed, 21 Nov 2012 22:06:04 +0000 (23:06 +0100)
firmware/adc.c

index 8bc171a390bd684ba79a345c39f377bb909cbbd2..38f36772a7aa6be7fa138351affb77e79b7f77b2 100644 (file)
@@ -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);