From 10330abf54b9908ca2c8f7bf630f156734579538 Mon Sep 17 00:00:00 2001
From: Jason Short <jasonshort@jasonshort.local>
Date: Fri, 25 Nov 2011 11:33:50 -0800
Subject: [PATCH] no longer using the raw pressure

---
 ArduCopter/ArduCopter.pde | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde
index 620161588..a81f59794 100644
--- a/ArduCopter/ArduCopter.pde
+++ b/ArduCopter/ArduCopter.pde
@@ -1260,17 +1260,9 @@ static void update_altitude()
 		baro_alt 			= (baro_alt + read_barometer()) >> 1;
 
 		// calc the vertical accel rate
-		#if CLIMB_RATE_BARO == 0
-		int temp_baro_alt	= (barometer._offset_press - barometer.RawPress) << 2; // invert and scale
-		temp_baro_alt		= (float)temp_baro_alt * .1 + (float)old_baro_alt * .9;
-
-		baro_rate 			= (temp_baro_alt - old_baro_alt) * 10;
-		old_baro_alt		= temp_baro_alt;
-
-		#else
-		baro_rate 			= (baro_alt - old_baro_alt) * 10;
+		int temp			= (baro_alt - old_baro_alt) * 10;
+		baro_rate 			= (temp + baro_rate) >> 1;
 		old_baro_alt		= baro_alt;
-		#endif
 
 		// sonar_alt is calculaed in a faster loop and filtered with a mode filter
 	#endif
-- 
GitLab