[All] getADC() now uses something between SINGLE and OSMP methods

This commit is contained in:
bsongis
2012-12-07 19:36:28 +00:00
parent f6caf5eae3
commit 8a98283cb0
+6 -11
View File
@@ -1562,19 +1562,14 @@ void getADC()
void getADC() void getADC()
{ {
uint16_t temp_ana; uint16_t temp_ana;
for (uint8_t adc_input=0; adc_input<8; adc_input++) { for (uint8_t adc_input=0; adc_input<8; adc_input++) {
temp_ana = 0;
ADMUX = adc_input|ADC_VREF_TYPE; ADMUX = adc_input|ADC_VREF_TYPE;
for (uint8_t i=0; i<2;i++) { // Going from 10bits to 11 bits. ADCSRA|=0x40; // Start the AD conversion
// Start the AD conversion while (ADCSRA & 0x40); // Wait for the AD conversion to complete
ADCSRA|=0x40; temp_ana = ADC;
// Wait for the AD conversion to complete ADCSRA|=0x40; // Start the second AD conversion
while ((ADCSRA & 0x10)==0); while (ADCSRA & 0x40); // Wait for the AD conversion to complete
ADCSRA|=0x10; s_anaFilt[adc_input] = temp_ana + ADC;
temp_ana += ADC;
}
s_anaFilt[adc_input] = temp_ana;
} }
} }
#endif #endif