changeset 769:6b248bcdbf28

Deactivation of the 'fallback' option when the CCR mode is set to 'Fixed' - this makes it a little clearer that the option has no influence in this mode.
author heinrichsweikamp
date Fri, 21 Apr 2023 09:47:06 +0200
parents dfdfea8897f3
children 8deb28b2d4da
files Discovery/Src/tMenuEditXtra.c Discovery/Src/tMenuXtra.c
diffstat 2 files changed, 13 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditXtra.c	Thu Apr 13 09:35:43 2023 +0200
+++ b/Discovery/Src/tMenuEditXtra.c	Fri Apr 21 09:47:06 2023 +0200
@@ -79,7 +79,6 @@
 {
     set_globalState_Menu_Line(line);
 
-
     /* DIVE MODE */
     if(actual_menu_content != MENU_SURFACE)
     {
@@ -114,7 +113,7 @@
     }
     else /* surface mode */
     {
-    	if((settingsGetPointer()->dive_mode != DIVEMODE_PSCR) && (line > 3))		/* PSCR items are only optional */
+        if((settingsGetPointer()->dive_mode != DIVEMODE_PSCR) && (line > 3))		/* PSCR items are only optional */
 		{
 			line = 6;
 		}
@@ -192,14 +191,10 @@
 
     SSettings *pSettings = settingsGetPointer();
 
-    if(pSettings->fallbackToFixedSetpoint == 0)
-    {
-    	pSettings->fallbackToFixedSetpoint = 1;
+    if (pSettings->CCR_Mode == CCRMODE_Sensors) {
+        pSettings->fallbackToFixedSetpoint = (pSettings->fallbackToFixedSetpoint + 1) % 2;
     }
-    else
-    {
-    	pSettings->fallbackToFixedSetpoint = 0;
-    }
+
     exitMenuEdit_to_Menu_with_Menu_Update_do_not_write_settings_for_this_only();
 }
 
--- a/Discovery/Src/tMenuXtra.c	Thu Apr 13 09:35:43 2023 +0200
+++ b/Discovery/Src/tMenuXtra.c	Fri Apr 21 09:47:06 2023 +0200
@@ -29,6 +29,7 @@
 /* Includes ------------------------------------------------------------------*/
 #include <stdio.h>
 #include <string.h>
+#include <stdbool.h>
 #include "tMenu.h"
 #include "tStructure.h"
 #include "tMenuXtra.h"
@@ -152,17 +153,24 @@
 
         if((line == 0) || (line == 2))
          {
+             bool canDoFallback = pSettings->CCR_Mode == CCRMODE_Sensors;
+             if (!canDoFallback) {
+                 text[textPointer++] = '\031';
+             }
              textPointer += snprintf(&text[textPointer], 60,\
                  "%c"
                  ,TXT_Fallback
              );
 
              text[textPointer++] = '\t';
-             if(settingsGetPointer()->fallbackToFixedSetpoint)
+             if(settingsGetPointer()->fallbackToFixedSetpoint && canDoFallback)
                  text[textPointer++] = '\005';
              else
                  text[textPointer++] = '\006';
 
+             if (!canDoFallback) {
+                 text[textPointer++] = '\020';
+             }
              strcpy(&text[textPointer],"\n\r");
              textPointer += 2;
          }