changeset 708:7e3bf2c0cd40

Menu cleanup rebreather specific settings: In the previous version the selection for Fix setpoint or sensor was in the deco menu and the Fallback option in the hardware menu. As they have a dependency and are only relevant for rebreather operation, they have been moved into the extra menu which is containing rebreather related data and which is only visible in rebreather mode.
author Ideenmodellierer
date Thu, 03 Nov 2022 20:44:51 +0100
parents e81afd727993
children c799151670d5
files Discovery/Src/tMenuEditHardware.c
diffstat 1 files changed, 7 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/tMenuEditHardware.c	Thu Nov 03 20:44:21 2022 +0100
+++ b/Discovery/Src/tMenuEditHardware.c	Thu Nov 03 20:44:51 2022 +0100
@@ -60,7 +60,6 @@
 uint8_t OnAction_Sensor1		(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_Sensor2		(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_Sensor3		(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-uint8_t OnAction_O2_Fallback	(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_O2_Calibrate   (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_O2_Source		(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 uint8_t OnAction_Button			(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
@@ -78,7 +77,6 @@
 void openEdit_Hardware(uint8_t line)
 {
     set_globalState_Menu_Line(line);
-    resetMenuEdit(CLUT_MenuPageHardware);
 
     switch(line)
     {
@@ -87,15 +85,18 @@
         openEdit_Bluetooth();
     break;
     case 2:
+    	resetMenuEdit(CLUT_MenuPageHardware);
         openEdit_Compass();
     break;
     case 3:
+    	resetMenuEdit(CLUT_MenuPageHardware);
         openEdit_O2Sensors();
     break;
     case 4:
         openEdit_Brightness();
     break;
     case 5:
+    	resetMenuEdit(CLUT_MenuPageHardware);
         openEdit_ButtonSens();
     break;
     case 6:
@@ -331,7 +332,7 @@
 		text[0] = TXT_2BYTE;
 		text[1] = TXT2BYTE_O2Interface;
 		text[2] = 0;
-		write_label_var(  30, 340, ME_Y_LINE6, &FontT48, text);
+		write_label_var(  30, 340, ME_Y_LINE5, &FontT48, text);
 		text[0] = TXT_2BYTE;
 		switch(settingsGetPointer()->ppo2sensors_source)
 		{
@@ -359,12 +360,11 @@
 #endif
 		}
 
-		write_label_var(  400, 800, ME_Y_LINE6, &FontT48, text);
+		write_label_var(  400, 800, ME_Y_LINE5, &FontT48, text);
     }
     tMenuEdit_refresh_field(StMHARD3_O2_Sensor1);
     tMenuEdit_refresh_field(StMHARD3_O2_Sensor2);
     tMenuEdit_refresh_field(StMHARD3_O2_Sensor3);
-    tMenuEdit_refresh_field(StMHARD3_O2_Fallback);
 
     if(get_globalState() == StMHARD3_O2_Calibrate)
     {
@@ -379,7 +379,6 @@
 
 void openEdit_O2Sensors(void)
 {
-    char text[2];
     uint8_t sensorActive[3];
 
     sensorActive[0] = 1;
@@ -408,14 +407,9 @@
         write_field_toggle(StMHARD3_O2_Calibrate,	400, 800, ME_Y_LINE4, &FontT48, "", 21, 98);
     }
 
-    text[0] = TXT_Fallback;
-    text[1] = 1;
-
-    write_field_on_off(StMHARD3_O2_Fallback,	 30, 500, ME_Y_LINE5,  &FontT48, text, settingsGetPointer()->fallbackToFixedSetpoint);
-
     if(DataEX_external_ADC_Present())
     {
-    	write_field_button(StMHARD3_O2_Source,	 30, 800, ME_Y_LINE6,  &FontT48, "");
+    	write_field_button(StMHARD3_O2_Source,	 30, 800, ME_Y_LINE5,  &FontT48, "");
     }
 
     setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1);
@@ -429,7 +423,7 @@
     {
     	setEvent(StMHARD3_O2_Calibrate, (uint32_t)OnAction_O2_Calibrate);
     }
-    setEvent(StMHARD3_O2_Fallback, (uint32_t)OnAction_O2_Fallback);
+
     if(DataEX_external_ADC_Present())
     {
     	setEvent(StMHARD3_O2_Source, (uint32_t)OnAction_O2_Source);
@@ -490,19 +484,6 @@
 }
 
 
-uint8_t OnAction_O2_Fallback	(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
-{
-    uint8_t fallback = settingsGetPointer()->fallbackToFixedSetpoint;
-
-    if(fallback)
-        fallback = 0;
-    else
-        fallback = 1;
-
-    settingsGetPointer()->fallbackToFixedSetpoint = fallback;
-    tMenuEdit_set_on_off(editId, fallback);
-    return UPDATE_DIVESETTINGS;
-}
 uint8_t OnAction_O2_Calibrate (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
 {
 	uint8_t loop;