changeset 648:ff2b393e290f

Motion detection: Enable focus after focus calibration: In previous version the focus detection was disabled while operating menus, also for the viewport calibration entry. As result when calibrating the view, it took some time till the focus was displayed (most likely causing confusion by the diver). To avoid this the suspension is now stopped when the view is calibrated => OSTC will enter focus mode using the new value
author Ideenmodellierer
date Mon, 19 Apr 2021 20:14:20 +0200
parents 15f6f0b5786c
children 60162a939c06
files Discovery/Src/motion.c Discovery/Src/tMenuEditXtra.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/motion.c	Tue Apr 13 19:25:41 2021 +0200
+++ b/Discovery/Src/motion.c	Mon Apr 19 20:14:20 2021 +0200
@@ -278,7 +278,7 @@
 detectionState_t detectSectorButtonEvent(float focusOffset)
 {
 	static uint8_t lastTargetSector = 0xFF;
-	static float lastfocusOffset = 0.0;
+	static float lastfocusOffset = 1000.0;
 
 	uint8_t newTargetSector;
 
@@ -288,6 +288,7 @@
 	if((newTargetSector != lastTargetSector) && (fabsf(focusOffset - lastfocusOffset) > (sectorDetection.size / 3)))
 	{
 		lastfocusOffset = focusOffset;
+		lastTargetSector = newTargetSector;
 		if(settingsGetPointer()->design == 3)		/* Big font view ? */
 		{
 			t3_select_customview(GetCVForSector(newTargetSector));
--- a/Discovery/Src/tMenuEditXtra.c	Tue Apr 13 19:25:41 2021 +0200
+++ b/Discovery/Src/tMenuEditXtra.c	Mon Apr 19 20:14:20 2021 +0200
@@ -111,6 +111,7 @@
 void openEdit_CalibViewport(void)
 {
 	calibrateViewport(stateUsed->lifeData.compass_roll, stateUsed->lifeData.compass_pitch, stateUsed->lifeData.compass_heading);
+	suspendMotionDetection(0);	/* exit to focus mode directly */
     exitMenuEdit_to_Home();
 }