# HG changeset patch
# User Ideenmodellierer
# Date 1609792708 -3600
# Node ID 132e7e3d13a7daa62210015cb9283fd3170ed906
# Parent  16e369eae6e5c99543175fbffda3fd4eb2386258
MotionControl-Sector: Map sectors during switch T7 <=> T3:
The number and available custom views may differ between the setup for T3 and T7 view. That's why the sectors have to be remapped during every T3 <=> T7 switch

diff -r 16e369eae6e5 -r 132e7e3d13a7 Discovery/Inc/motion.h
--- a/Discovery/Inc/motion.h	Mon Jan 04 21:35:38 2021 +0100
+++ b/Discovery/Inc/motion.h	Mon Jan 04 21:38:28 2021 +0100
@@ -76,6 +76,7 @@
 void resetMotionDeltaHistory();
 void evaluateMotionDelta(float roll, float pitch, float yaw);
 void DefinePitchSectors(float centerAngle, uint8_t numOfSectors);
+void MapCVToSector(void);
 detectionState_t detectPitch(float currentPitch);
 detectionState_t detectSectorButtonEvent(float curPitch);
 detectionState_t detectScrollButtonEvent(float curPitch);
diff -r 16e369eae6e5 -r 132e7e3d13a7 Discovery/Src/base.c
--- a/Discovery/Src/base.c	Mon Jan 04 21:35:38 2021 +0100
+++ b/Discovery/Src/base.c	Mon Jan 04 21:38:28 2021 +0100
@@ -792,6 +792,7 @@
 							if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR)
 							{
 								DefinePitchSectors(settingsGetPointer()->viewPitch,CUSTOMER_DEFINED_VIEWS);
+								MapCVToSector();
 							}
 						}
 					}
@@ -807,6 +808,7 @@
 						if(settingsGetPointer()->MotionDetection == MOTION_DETECT_SECTOR)
 						{
 							DefinePitchSectors(settingsGetPointer()->viewPitch,CUSTOMER_DEFINED_VIEWS);
+							MapCVToSector();
 						}
 					}
 					else if (settingsGetPointer()->extraDisplay	== EXTRADISPLAY_DECOGAME)