From 3654c714e9e89f3bb075b090d5670cfeb492034f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 17 Dec 2011 07:21:43 +1100 Subject: [PATCH] Revert "ADC: only read channels that are actually being used" This reverts commit 95e6bb26f4772ca8c7faa62215de6f078d3df3c7. ADC will be disabled on APM2 --- libraries/AP_ADC/AP_ADC_ADS7844.cpp | 35 ++--------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/libraries/AP_ADC/AP_ADC_ADS7844.cpp b/libraries/AP_ADC/AP_ADC_ADS7844.cpp index 5dcce0303b..12affb8787 100644 --- a/libraries/AP_ADC/AP_ADC_ADS7844.cpp +++ b/libraries/AP_ADC/AP_ADC_ADS7844.cpp @@ -63,11 +63,6 @@ static volatile uint32_t _sum[8]; // how many values we've accumulated since last read static volatile uint16_t _count[8]; -// a mask of what channels are actually being read. If a channel has -// never been read, then don't bother gathering it. That saves us a -// lot of cycles in the timer call -static uint8_t enable_mask; - static uint32_t last_ch6_micros; // TCNT2 values for various interrupt rates, @@ -92,35 +87,15 @@ static inline unsigned char ADC_SPI_transfer(unsigned char data) void AP_ADC_ADS7844::read(void) { uint8_t ch; - unsigned char enable_cmd[9]; - uint8_t num_enabled = 0; - - if (enable_mask == 0) { - // no channels to read - return; - } - - for (ch = 0; ch < 8; ch++) { - if (enable_mask & (1<