diff Discovery/Src/tMenuEditSystem.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 50ea68c7a153
children 0dbf550dc743
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditSystem.c	Mon Aug 19 17:50:55 2019 +0200
+++ b/Discovery/Src/tMenuEditSystem.c	Sun Sep 08 13:45:17 2019 +0200
@@ -155,6 +155,7 @@
 
     pSettings->cv_configuration ^= 1 << (cv_changelist[line-1]);
     WriteSettings = 1;
+    InitMotionDetection(); /* consider new view setup for view selection by motion */
     exitMenuEdit_to_Menu_with_Menu_Update();
 }
 
@@ -925,6 +926,9 @@
 		case MOTION_DETECT_SECTOR:
 			text[5] = TXT2BYTE_MoCtrlSector;
 			break;
+		case MOTION_DETECT_SCROLL:
+			text[5] = TXT2BYTE_MoCtrlScroll;
+					break;
 		default:
 			snprintf(&text[4],2,"%u",settingsGetPointer()->MotionDetection);
 		break;
@@ -1075,20 +1079,24 @@
     uint8_t newValue;
     switch(settingsGetPointer()->MotionDetection)
     {
-    case 0:
-        newValue = 1;
+    case MOTION_DETECT_OFF:
+        newValue = MOTION_DETECT_MOVE;
         break;
-    case 1:
-        newValue = 2;
+    case MOTION_DETECT_MOVE:
+        newValue = MOTION_DETECT_SECTOR;
         break;
-    case 2:
-        newValue = 0;
+    case MOTION_DETECT_SECTOR:
+        newValue = MOTION_DETECT_SCROLL;
         break;
+    case MOTION_DETECT_SCROLL:
+    	newValue = MOTION_DETECT_OFF;
+    	break;
     default:
-        newValue = 0;
+        newValue = MOTION_DETECT_OFF;
         break;
     }
     settingsGetPointer()->MotionDetection = newValue;
+    InitMotionDetection();
     return UNSPECIFIC_RETURN;
 }