diff Discovery/Src/t3.c @ 835:717b460294cd Evo_2_23

Added autofocus for BF Navigation view: In case of activated autofocus feature for big font the navigation view will now be activated in case the OSTC4 is hold in horizontal position (like it is for example done if you take a bearing). The OSTC4 will return to the previous view in case the OSTC4 is no longer hold in horizontal position.
author Ideenmodellierer
date Sun, 17 Dec 2023 21:49:02 +0100
parents 107c29934671
children 18946846b95b
line wrap: on
line diff
--- a/Discovery/Src/t3.c	Sun Dec 17 21:14:17 2023 +0100
+++ b/Discovery/Src/t3.c	Sun Dec 17 21:49:02 2023 +0100
@@ -40,6 +40,7 @@
 #include "unit.h"
 #include "motion.h"
 #include "logbook_miniLive.h"
+#include "tMenuEditCustom.h"
 
 
 #define CV_PROFILE_WIDTH		(600U)
@@ -1987,3 +1988,26 @@
         return snprintf(text, size, "%c%u\016\016%%\017", colour, currentTimerMinutes * 100 / settingsGetPointer()->scrubberData[settings->scubberActiveId].TimerMax);
     }
 }
+void t3_handleAutofocus(void)
+{
+	static uint8_t returnView = CVIEW_T3_END;
+
+	if(stateUsed->diveSettings.activeAFViews & (1 << CVIEW_T3_Navigation))
+	{
+		switch(HandleAFCompass())
+		{
+			case AF_VIEW_ACTIVATED:	returnView = t3_selection_customview;
+									t3_select_customview(CVIEW_T3_Navigation);
+
+				break;
+			case AF_VIEW_DEACTIVATED: if((returnView != CVIEW_T3_END) && (t3_selection_customview == CVIEW_T3_Navigation))
+										{
+											t3_select_customview(returnView);
+											returnView = CVIEW_T3_END;
+										}
+				break;
+			default:
+				break;
+		}
+	}
+}