From 9b95d2060a8690253857ad2c3d5aabe3625ff645 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 27 Mar 2012 15:17:28 +1100 Subject: [PATCH] ADC: minor fix to the ADC Ch6() code we don't need to add count any more, as floating point maths doesn't need to round up --- libraries/AP_ADC/AP_ADC_ADS7844.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_ADC/AP_ADC_ADS7844.cpp b/libraries/AP_ADC/AP_ADC_ADS7844.cpp index 29a694ae08..7a925e6351 100644 --- a/libraries/AP_ADC/AP_ADC_ADS7844.cpp +++ b/libraries/AP_ADC/AP_ADC_ADS7844.cpp @@ -228,7 +228,7 @@ uint32_t AP_ADC_ADS7844::Ch6(const uint8_t *channel_numbers, float *result) // division. That costs us 36 bytes of stack, but I think its // worth it. for (i = 0; i < 6; i++) { - result[i] = (sum[i] + count[i]) / (float)count[i]; + result[i] = sum[i] / (float)count[i]; } // return number of microseconds since last call