diff Discovery/Src/tHome.c @ 384:427ae9f8e28e MotionDetection

Consider number of available t3 views in sector handling: Before chande the number of sectors were taken from t7 view only causing t3 view to be shown inconsistent in case t7 view count were not 6. => added function to count views.
author ideenmodellierer
date Thu, 17 Oct 2019 23:09:17 +0200
parents 0dbf550dc743
children 39c147e47c1c
line wrap: on
line diff
--- a/Discovery/Src/tHome.c	Thu Oct 17 21:15:42 2019 +0200
+++ b/Discovery/Src/tHome.c	Thu Oct 17 23:09:17 2019 +0200
@@ -148,8 +148,13 @@
             return;
 
         if(settingsGetPointer()->design == 3)
+        {
             settingsGetPointer()->design = 7;
-
+        	if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR)
+        	{
+        		DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS);
+        	}
+        }
         switch(get_globalState())
         {
         case StD:
@@ -239,8 +244,14 @@
         if(settingsGetPointer()->design == 4)
             return;
 
-        if(settingsGetPointer()->design == 3)
+        if(settingsGetPointer()->design == 3)	/* switch back to t7 (standard) view */
+        {
             settingsGetPointer()->design = 7;
+        	if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR)
+        	{
+        		DefinePitchSectors(stateRealGetPointer()->lifeData.compass_pitch,CUSTOMER_DEFINED_VIEWS);
+        	}
+        }
 
         switch(get_globalState())
         {