diff Discovery/Src/base.c @ 377:939bc4da6812 MotionDetection

Motion events effect custom view in dive mode only For faster tests motion detection was also applied to the surface menu. On surface users will most likly use the buttons for operation => deactivated detection to avoid jumping views
author ideenmodellierer
date Mon, 16 Sep 2019 20:57:40 +0200
parents 7b981f8bdd41
children a7331e4a9ca6
line wrap: on
line diff
--- a/Discovery/Src/base.c	Mon Sep 16 20:21:06 2019 +0200
+++ b/Discovery/Src/base.c	Mon Sep 16 20:57:40 2019 +0200
@@ -488,17 +488,20 @@
 	        DoDisplayRefresh = 0;
         	RefreshDisplay();
 
-        	switch(settingsGetPointer()->MotionDetection)
+        	if(stateUsed->mode == MODE_DIVE)			/* handle motion events in divemode only */
         	{
-        		case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch);
-        			break;
-        		case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch);
-        			break;
-        		case MOTION_DETECT_SCROLL: pitchstate = detectScrollButtonEvent(stateRealGetPointer()->lifeData.compass_pitch);
-        		     break;
-        		default:
-        			pitchstate = DETECT_NOTHING;
-        			break;
+				switch(settingsGetPointer()->MotionDetection)
+				{
+					case MOTION_DETECT_MOVE: pitchstate = detectPitch(stateRealGetPointer()->lifeData.compass_pitch);
+						break;
+					case MOTION_DETECT_SECTOR: pitchstate = detectSectorButtonEvent(stateRealGetPointer()->lifeData.compass_pitch);
+						break;
+					case MOTION_DETECT_SCROLL: pitchstate = detectScrollButtonEvent(stateRealGetPointer()->lifeData.compass_pitch);
+						 break;
+					default:
+						pitchstate = DETECT_NOTHING;
+						break;
+				}
         	}
 
 			if(DETECT_NEG_PITCH == pitchstate)