diff Discovery/Src/tHome.c @ 775:46c6d2380d4e

Add a shortcuts to change the setpoint to the loop to the 'normal' display when diving. It is only shown when diving in CCR mode and on the loop. Uses the configured setpoint with the highest / lowest switch depth as the high / low setpoints respectively. (mikeller)
author heinrichsweikamp
date Thu, 11 May 2023 12:13:03 +0200
parents 6169309d6eb9
children 6a8cf91e5b22
line wrap: on
line diff
--- a/Discovery/Src/tHome.c	Wed May 10 16:25:39 2023 +0200
+++ b/Discovery/Src/tHome.c	Thu May 11 12:13:03 2023 +0200
@@ -281,6 +281,16 @@
 
             break;
         case StDBAILOUT:
+            if (settingsGetPointer()->dive_mode == DIVEMODE_CCR && isLoopMode(stateUsed->diveSettings.diveMode) && findSwitchToSetpoint()) {
+                set_globalState(StDSETPOINT);
+
+                break;
+            }
+
+            checkSetStateSim(settings);
+
+            break;
+        case StDSETPOINT:
             checkSetStateSim(settings);
 
             break;
@@ -484,6 +494,12 @@
             set_globalState(StD);
 
             break;
+        case StDSETPOINT:
+            checkSwitchSetpoint();
+
+            set_globalState(StD);
+
+            break;
         case StDBEAR: // t5_gauge
             setCompassHeading((uint16_t)stateUsed->lifeData.compass_heading);
             set_globalState(StD);