From 68424ad19806bd6f0b857e878bf632cf5851e7c5 Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Thu, 29 Nov 2012 14:05:08 +0100 Subject: [PATCH] adc.c: keep ADC enabled --- firmware/adc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/firmware/adc.c b/firmware/adc.c index 298256f..ba30e5c 100644 --- a/firmware/adc.c +++ b/firmware/adc.c @@ -16,8 +16,6 @@ static uint16_t adc1_gain20_offset_x16; 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 @@ -100,8 +98,6 @@ void init_adc() } ADCSRA |= _BV(ADIE); // enable IRQ - - ADCSRA &= ~_BV(ADEN); // disable until needed } void susp_adc() @@ -116,8 +112,6 @@ ISR(ADC_vect) { // IRQ handler 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 -- 2.39.3