diff Discovery/Src/base.c @ 373:7b981f8bdd41 MotionDetection

Add scroll event by pitch angle detection: Add a function to scroll through the custom view in case the computer is not in the typical center position Refine Pitch Detection: Changed implementation to use sectors for detection. Increased detection window
author ideenmodellierer
date Sun, 08 Sep 2019 13:45:17 +0200
parents fca370f847f8
children 939bc4da6812
line wrap: on
line diff
--- a/Discovery/Src/base.c	Mon Aug 19 17:50:55 2019 +0200
+++ b/Discovery/Src/base.c	Sun Sep 08 13:45:17 2019 +0200
@@ -494,6 +494,8 @@
         			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;
@@ -902,9 +904,9 @@
 						if ((status.page == PageDive) && (status.line == 0))
 						{
 							tHome_change_customview_button_pressed(action);
-							if((settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR) && (action == ACTION_BUTTON_ENTER))  /* Button pressed while sector detection is active => calibrate to current pitch value */
+							if((settingsGetPointer()->MotionDetection != MOTION_DETECT_OFF) && (action == ACTION_BUTTON_ENTER))  /* Button pressed while motion detection is active => calibrate to current pitch value */
 							{
-								DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS);
+								DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_KEEP_LAST_SECTORS);
 							}
 						}
 						else if (status.page == PageSurface)