diff Discovery/Src/motion.c @ 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 c737cf5d9067
children
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));