changeset 703:2f457024049b

Added selection of digital o2 sensor source to HW menu: Beside analog sensing a pure digital and a mixed mode (analag + digital) may now be selected by the HW sensor menu. Bugfix: cursor was jumping to the first menu item in case the sensor source was changed. This was fixed and the cursor now stays at the sensor input selection.
author Ideenmodellierer
date Fri, 28 Oct 2022 20:32:24 +0200
parents 6d7c812fc173
children f1b40364b0af
files Discovery/Inc/text_multilanguage.h Discovery/Src/tMenuEditHardware.c Discovery/Src/text_multilanguage.c
diffstat 3 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Inc/text_multilanguage.h	Fri Oct 28 20:29:37 2022 +0200
+++ b/Discovery/Inc/text_multilanguage.h	Fri Oct 28 20:32:24 2022 +0200
@@ -287,6 +287,7 @@
 		TXT2BYTE_O2Interface,
 		TXT2BYTE_O2IFOptic,
 		TXT2BYTE_O2IFAnalog,
+		TXT2BYTE_O2IFDigital,
 		TXT2BYTE_LowerIsLess,
 		TXT2BYTE_DiveMenuQ,
 		TXT2BYTE_DiveQuitQ,
--- a/Discovery/Src/tMenuEditHardware.c	Fri Oct 28 20:29:37 2022 +0200
+++ b/Discovery/Src/tMenuEditHardware.c	Fri Oct 28 20:32:24 2022 +0200
@@ -342,6 +342,17 @@
 			case O2_SENSOR_SOURCE_ANALOG: 	text[1] = TXT2BYTE_O2IFAnalog;
 											text[2] = 0;
 				break;
+			case O2_SENSOR_SOURCE_DIGITAL: 	text[1] = TXT2BYTE_O2IFDigital;
+											text[2] = 0;
+				break;
+			case O2_SENSOR_SOURCE_ANADIG: 	text[1] = TXT2BYTE_O2IFAnalog;
+											text[2] = ' ';
+											text[3] = '+';
+											text[4] = ' ';
+											text[5] = TXT_2BYTE;
+											text[6] = TXT2BYTE_O2IFDigital;
+											text[7] = 0;
+				break;
 #ifdef ENABLE_SENTINEL_MODE
 			case O2_SENSOR_SOURCE_SENTINEL: snprintf(text, 10,"Sentinel");
 				break;
@@ -385,7 +396,7 @@
     write_field_on_off(StMHARD3_O2_Sensor2,	 30, 95, ME_Y_LINE2,  &FontT48, "", sensorActive[1]);
     write_field_on_off(StMHARD3_O2_Sensor3,	 30, 95, ME_Y_LINE3,  &FontT48, "", sensorActive[2]);
 
-    if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG)
+    if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG)
 #ifdef ENABLE_SENTINEL_MODE
     		|| (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL)
 #endif
@@ -410,7 +421,7 @@
     setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1);
     setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2);
     setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3);
-    if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG)
+    if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG)
 #ifdef ENABLE_SENTINEL_MODE
     		|| (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL)
 #endif
@@ -562,6 +573,7 @@
 
     resetMenuEdit(CLUT_MenuPageHardware); 	/* rebuild menu structure (Hide HUD <=> Show Calibrate) */
     openEdit_O2Sensors();
+    tMenuEdit_select(StMHARD3_O2_Source);
     return UPDATE_DIVESETTINGS;
 }
 
--- a/Discovery/Src/text_multilanguage.c	Fri Oct 28 20:29:37 2022 +0200
+++ b/Discovery/Src/text_multilanguage.c	Fri Oct 28 20:32:24 2022 +0200
@@ -1291,6 +1291,12 @@
 static uint8_t text_IT_O2IFAnalog[] = "";
 static uint8_t text_ES_O2IFAnalog[] = "";
 
+static uint8_t text_EN_O2IFDigital[] = "digital";
+static uint8_t text_DE_O2IFDigital[] = "digital";
+static uint8_t text_FR_O2IFDigital[] = "";
+static uint8_t text_IT_O2IFDigital[] = "";
+static uint8_t text_ES_O2IFDigital[] = "";
+
 // Menu SYS1 sub (buttons)
 static uint8_t text_EN_LowerIsLess[] = "Lower is less sensitive";
 static uint8_t text_DE_LowerIsLess[] = "Niedriger ist schwergängiger";
@@ -1954,6 +1960,7 @@
 	{(uint8_t)TXT2BYTE_O2Interface,		{text_EN_O2Interface, text_DE_O2Interface, text_FR_O2Interface, text_IT_O2Interface, text_ES_O2Interface}},
 	{(uint8_t)TXT2BYTE_O2IFOptic,		{text_EN_O2IFOptic, text_DE_O2IFOptic, text_FR_O2IFOptic, text_IT_O2IFOptic, text_ES_O2IFOptic}},
 	{(uint8_t)TXT2BYTE_O2IFAnalog,		{text_EN_O2IFAnalog, text_DE_O2IFAnalog, text_FR_O2IFAnalog, text_IT_O2IFAnalog, text_ES_O2IFAnalog}},
+	{(uint8_t)TXT2BYTE_O2IFDigital,		{text_EN_O2IFDigital, text_DE_O2IFDigital, text_FR_O2IFDigital, text_IT_O2IFDigital, text_ES_O2IFDigital}},
     {(uint8_t)TXT2BYTE_LowerIsLess,		{text_EN_LowerIsLess, text_DE_LowerIsLess, text_FR_LowerIsLess, text_IT_LowerIsLess, text_ES_LowerIsLess}},
     {(uint8_t)TXT2BYTE_DiveMenuQ,		{text_EN_DiveMenuQ, text_DE_DiveMenuQ, text_FR_DiveMenuQ, text_IT_DiveMenuQ, text_ES_DiveMenuQ}},
     {(uint8_t)TXT2BYTE_DiveQuitQ,		{text_EN_DiveQuitQ, text_DE_DiveQuitQ, text_FR_DiveQuitQ, text_IT_DiveQuitQ, text_ES_DiveQuitQ}},