diff Discovery/Src/tMenuEditHardware.c @ 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 4dd487b407f7
children 7e3bf2c0cd40
line wrap: on
line diff
--- 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;
 }