changeset 1055:de56b8d75504 Icon_Integration

LLC data: improve switching: In the previous version an inactive view could be shown in case two inactive views are located after each other. To avoid this scenario the views are now switched until an active view is available. The scrubber time is now only shown in rebreather mode.
author Ideenmodellierer
date Sat, 03 Jan 2026 20:40:11 +0100
parents 8fe6676f28c9
children b241efe09963
files Discovery/Src/t7.c
diffstat 1 files changed, 31 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/t7.c	Wed Dec 31 17:52:03 2025 +0100
+++ b/Discovery/Src/t7.c	Sat Jan 03 20:40:11 2026 +0100
@@ -3201,34 +3201,44 @@
 
 void t7_change_field(void)
 {
+	SSettings *settings = settingsGetPointer();
     selection_custom_field++;
 
-    if((stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) && ((selection_custom_field == LLC_GF) || (selection_custom_field == LCC_GF_SURF))) /* no GF if in VPM mode */
+    uint8_t checkAgain = 0;
+
+    do
     {
-    	selection_custom_field++;
-    }
-    SSettings *settings = settingsGetPointer();
-    if (selection_custom_field == LLC_ScrubberTime && !isScrubberTimerEnabled(settings)) {
-    	selection_custom_field++;
-    }
+    	checkAgain = 0;
+		if((stateUsed->diveSettings.deco_type.ub.standard == VPM_MODE) && ((selection_custom_field == LLC_GF) || (selection_custom_field == LCC_GF_SURF))) /* no GF if in VPM mode */
+		{
+			selection_custom_field++;
+			checkAgain = 1;
+		}
+
+		if ((selection_custom_field == LLC_ScrubberTime) && ((!isScrubberTimerEnabled(settings)) || (!isLoopMode(stateUsed->diveSettings.diveMode))))
+		{
+			selection_custom_field++;
+			checkAgain = 1;
+		}
 #ifdef ENABLE_PSCR_MODE
-    if((selection_custom_field == LCC_SimPpo2) && (settings->dive_mode != DIVEMODE_PSCR))
-    {
-    	selection_custom_field++;
-    }
+		if((selection_custom_field == LCC_SimPpo2) && (settings->dive_mode != DIVEMODE_PSCR))
+		{
+			selection_custom_field++;
+			checkAgain = 1;
+		}
 #endif
 #ifdef ENABLE_CO2_SUPPORT
-    if((selection_custom_field == LCC_CO2) && (settings->co2_sensor_active == 0))
-    {
-       	selection_custom_field++;
-    }
-
+		if((selection_custom_field == LCC_CO2) && (settings->co2_sensor_active == 0))
+		{
+			selection_custom_field++;
+			checkAgain = 1;
+		}
 #endif
-
-    if(selection_custom_field >= LLC_END)
-    {
-        selection_custom_field = LLC_Empty;
-    }
+		if(selection_custom_field >= LLC_END)
+		{
+			selection_custom_field = LLC_Empty;
+		}
+    } while (checkAgain);
 }