From fbb35928feabdc18a48b6133f39c935bca7e6e98 Mon Sep 17 00:00:00 2001 From: Jason Short Date: Mon, 26 Dec 2011 15:13:47 -0800 Subject: [PATCH] removed unused function Simplified the baro init filter --- ArduCopter/sensors.pde | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/ArduCopter/sensors.pde b/ArduCopter/sensors.pde index 44c1a84767..a80f80aa9d 100644 --- a/ArduCopter/sensors.pde +++ b/ArduCopter/sensors.pde @@ -45,7 +45,7 @@ static void init_barometer(void) // Get initial data from absolute pressure sensor barometer.read(); ground_pressure = barometer.get_pressure(); - ground_temperature = (ground_temperature * 9 + barometer.get_temperature()) / 10; + ground_temperature = (ground_temperature * 7 + barometer.get_temperature()) / 8; //Serial.printf("init %ld, %d, -, %ld, %ld, -, %d, %ld\n", barometer.RawTemp, barometer.Temp, barometer.RawPress, barometer.Press, ground_temperature, ground_pressure); } @@ -55,37 +55,12 @@ static void init_barometer(void) //SendDebugln("barometer calibration complete."); } -/* -static int32_t read_baro_filtered(void) +static void reset_baro(void) { - - // get new data from absolute pressure sensor - barometer.Read(); - - return barometer.Press; - - int32_t pressure = 0; - // add new data into our filter - baro_filter[baro_filter_index] = barometer.Press; - baro_filter_index++; - - // loop our filter - if(baro_filter_index >= BARO_FILTER_SIZE) - baro_filter_index = 0; - - // zero out our accumulator - - // sum our filter - for(byte i = 0; i < BARO_FILTER_SIZE; i++){ - pressure += baro_filter[i]; - } - - - // average our sampels - return pressure /= BARO_FILTER_SIZE; - // + ground_pressure = barometer.get_pressure(); + ground_temperature = barometer.get_temperature(); } -*/ + static int32_t read_barometer(void) { float x, scaling, temp;