static void inline setup_mux(unsigned char n)
{
- ADCSRA |= _BV(ADEN); // enable ADC
-
/* ADC numbering: PWM LEDs first, then ambient light sensor, battery sensor */
switch (n) {
case 0: // pwmled 1: 1.1V, ADC0,1 (PA0,1), gain 20
}
ADCSRA |= _BV(ADIE); // enable IRQ
-
- ADCSRA &= ~_BV(ADEN); // disable until needed
}
void susp_adc()
if (adc_vals)
// start the next conversion immediately
ADCSRA |= _BV(ADSC);
- else
- ADCSRA &= ~_BV(ADEN); // the last one, disable ADC
if (adc_vals < (1 << sum_shift))
// drop the first conversion, use all others