diff Small_CPU/Src/pressure.c @ 403:6f30f2011667

We got one report of false/freezd depth reading when jumping into 2m depth instantaneously. The "PRESSURE_JUMP_VALID_MBAR" threshold was removed, the new behaviour was tested in the pressure tank intensively and it's simply better/more reliable without this threshold.
author heinrichsweikamp
date Wed, 08 Jan 2020 15:35:15 +0100
parents cb3870f79e9d
children 4be72d55b09a
line wrap: on
line diff
--- a/Small_CPU/Src/pressure.c	Sun Jan 05 14:57:50 2020 +0000
+++ b/Small_CPU/Src/pressure.c	Wed Jan 08 15:35:15 2020 +0100
@@ -51,7 +51,6 @@
 
 #define PRESSURE_SURFACE_MAX_MBAR			(1030.0f)		/* It is unlikely that pressure at surface is greater than this value => clip to it */
 #define PRESSURE_HISTORY_SIZE				(8u)
-#define PRESSURE_JUMP_VALID_MBAR	    	(500.0f)		/* values are measure several times a second => jumps > 5m very unlikely */
 
 #define PRESSURE_SURFACE_QUE					(30u)			/* history buffer [minutes] for past pressure measurements */
 #define PRESSURE_SURFACE_EVA_WINDOW				(15u)			/* Number of entries evaluated during instability test. Used to avoid detection while dive enters water */
@@ -632,12 +631,9 @@
 	}
 	else
 	{
-		if(fabs(pressurevalue - pressure_average) < PRESSURE_JUMP_VALID_MBAR)
-		{
 			pressure_history_mbar[pressurewriteindex++] = pressurevalue;
 			pressurewriteindex &= 0x7;	/* wrap around if necessary */
 			retval = 1;
-		}
 	}
 
 	return retval;