changeset 827:ffb1036c27c2 Evo_2_23

Moved CO2 Menu from Xtra to Hardware: The first CO2 sensor menu implementation was placed within the Xtra menu. In the new version the CO2 options may be accessed using the sensor overview menu of the Hardware page. With this change it is no longer necessary to take care for compile switches in the menus because the menu will only be shown if a CO2 sensor is detected.
author Ideenmodellierer
date Sun, 05 Nov 2023 20:19:08 +0100
parents a370741a743b
children 107c29934671
files Discovery/Src/tInfoSensor.c Discovery/Src/tMenuEditHardware.c Discovery/Src/tMenuEditXtra.c Discovery/Src/tMenuHardware.c Discovery/Src/tMenuXtra.c
diffstat 5 files changed, 137 insertions(+), 148 deletions(-) [+]
line wrap: on
line diff
--- a/Discovery/Src/tInfoSensor.c	Wed Oct 11 17:49:19 2023 +0200
+++ b/Discovery/Src/tInfoSensor.c	Sun Nov 05 20:19:08 2023 +0100
@@ -34,6 +34,7 @@
 #include "tInfo.h"
 #include "tInfoSensor.h"
 #include "tMenuEdit.h"
+#include "data_exchange_main.h"
 
 #include <string.h>
 #include <inttypes.h>
@@ -139,8 +140,7 @@
     }
 }
 
-//  ===============================================================================
-void refreshInfo_Sensor(GFX_DrawCfgScreen s)
+static void refreshInfo_SensorO2(GFX_DrawCfgScreen s)
 {
 	const SDiveState *pStateReal = stateRealGetPointer();
     SSensorDataDiveO2* pDiveO2Data;
@@ -150,6 +150,98 @@
 
     float pressure = 0.0;
 
+    pDiveO2Data = (SSensorDataDiveO2*)pStateReal->lifeData.extIf_sensor_data[activeSensorId];
+	strIndex = snprintf(text,32,"ID: ");
+	if(pDiveO2Data->sensorId != 0)
+	{
+		uint64ToString(pDiveO2Data->sensorId,&text[strIndex]);
+	}
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE1, &FontT48, text, CLUT_Font020);
+	snprintf(text,32,"%c: %02.1f",TXT_Temperature , (float)pDiveO2Data->temperature / 1000.0);
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE2, &FontT48, text, CLUT_Font020);
+
+#ifdef ENABLE_EXTERNAL_PRESSURE
+	pressure = (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[2]);
+#else
+	pressure = (float)pDiveO2Data->pressure / 1000.0;
+#endif
+	snprintf(text,32,"Druck: %02.1f (%02.1f)", (float)pDiveO2Data->pressure / 1000.0, pressure *1000.0);
+
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE3, &FontT48, text, CLUT_Font020);
+	snprintf(text,32,"Feuchtigkeit: %02.1f", (float)pDiveO2Data->humidity / 1000.0);
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE4, &FontT48, text, CLUT_Font020);
+	snprintf(text,32,"Status: 0x%lx", pDiveO2Data->status);
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE5, &FontT48, text, CLUT_Font020);
+#ifdef ENABLE_EXTERNAL_PRESSURE
+	snprintf(text,32,"Norm ppO2: %02.3f (%02.1f)", (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0] / (pressure / 1000.0)),(float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0]));
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
+#endif
+
+	if(sensorActive)
+	{
+		*textPointer++ = '\005';
+	}
+	else
+	{
+		*textPointer++ = '\006';
+	}
+	*textPointer++ = ' ';
+	*textPointer++ = TXT_2BYTE;
+	*textPointer++ = TXT2BYTE_Sensor;
+	*textPointer++ = ' ';
+	*textPointer++ = TXT_2BYTE;
+	*textPointer++ = TXT2BYTE_O2IFDigital;
+	*textPointer++ = '1' + activeSensorId;
+
+	snprintf(textPointer, 20,": %01.2f, %01.1f mV",  pStateReal->lifeData.ppO2Sensor_bar[activeSensorId], pStateReal->lifeData.sensorVoltage_mV[activeSensorId]);
+
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
+
+	tInfo_write_buttonTextline_simple(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,0);
+}
+
+static void refreshInfo_SensorCo2(GFX_DrawCfgScreen s)
+{
+	const SDiveState *pStateReal = stateRealGetPointer();
+    char text[31];
+    char *textPointer = text;
+
+    snprintf(text,32,"CO2: %ld ppm",pStateReal->lifeData.CO2_data.CO2_ppm);
+    tInfo_write_content_simple(  30, 770, ME_Y_LINE1, &FontT48, text, CLUT_Font020);
+
+
+    snprintf(text,32,"Signal: %d",pStateReal->lifeData.CO2_data.signalStrength);
+    tInfo_write_content_simple(  30, 770, ME_Y_LINE2, &FontT48, text, CLUT_Font020);
+
+	if(sensorActive)
+	{
+		*textPointer++ = '\005';
+	}
+	else
+	{
+		*textPointer++ = '\006';
+	}
+	*textPointer++ = ' ';
+	*textPointer++ = TXT_2BYTE;
+	*textPointer++ = TXT2BYTE_Sensor;
+	*textPointer++ = ' ';
+	*textPointer++ = 'C';
+	*textPointer++ = 'o';
+	*textPointer++ = '1' + activeSensorId;
+
+	snprintf(textPointer, 20,": %ld ppm",  pStateReal->lifeData.CO2_data.CO2_ppm);
+
+	tInfo_write_content_simple(  30, 770, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
+
+	tInfo_write_buttonTextline_simple(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_O2Calib);
+}
+//  ===============================================================================
+void refreshInfo_Sensor(GFX_DrawCfgScreen s)
+{
+	const SDiveState *pStateReal = stateRealGetPointer();
+
+    char text[31];
+
     text[0] = '\001';
 	text[1] = TXT_Sensor;
 	text[2] = ' ';
@@ -159,55 +251,14 @@
 	text[6] = 0;
 	tInfo_write_content_simple(  30, 770, ME_Y_LINE_BASE, &FontT48, text, CLUT_MenuPageHardware);
 
-    pDiveO2Data = (SSensorDataDiveO2*)&stateRealGetPointer()->lifeData.extIf_sensor_data[activeSensorId];
-
-    strIndex = snprintf(text,32,"ID: ");
-    if(pDiveO2Data->sensorId != 0)
-    {
-    	uint64ToString(pDiveO2Data->sensorId,&text[strIndex]);
-    }
-    tInfo_write_content_simple(  30, 770, ME_Y_LINE1, &FontT48, text, CLUT_Font020);
-    snprintf(text,32,"%c: %02.1f",TXT_Temperature , (float)pDiveO2Data->temperature / 1000.0);
-    tInfo_write_content_simple(  30, 770, ME_Y_LINE2, &FontT48, text, CLUT_Font020);
-
-#ifdef ENABLE_EXTERNAL_PRESSURE
-    pressure = (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[2]);
-#else
-    pressure = (float)pDiveO2Data->pressure / 1000.0;
-#endif
-    snprintf(text,32,"Druck: %02.1f (%02.1f)", (float)pDiveO2Data->pressure / 1000.0, pressure *1000.0);
-
-    tInfo_write_content_simple(  30, 770, ME_Y_LINE3, &FontT48, text, CLUT_Font020);
-    snprintf(text,32,"Feuchtigkeit: %02.1f", (float)pDiveO2Data->humidity / 1000.0);
-    tInfo_write_content_simple(  30, 770, ME_Y_LINE4, &FontT48, text, CLUT_Font020);
-    snprintf(text,32,"Status: 0x%lx", pDiveO2Data->status);
-    tInfo_write_content_simple(  30, 770, ME_Y_LINE5, &FontT48, text, CLUT_Font020);
-#ifdef ENABLE_EXTERNAL_PRESSURE
-    snprintf(text,32,"Norm ppO2: %02.3f (%02.1f)", (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0] / (pressure / 1000.0)),(float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0]));
-    tInfo_write_content_simple(  30, 770, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
-#endif
-
-    if(sensorActive)
-    {
-    	*textPointer++ = '\005';
-    }
-    else
-    {
-    	*textPointer++ = '\006';
-    }
-    *textPointer++ = ' ';
-    *textPointer++ = TXT_2BYTE;
-    *textPointer++ = TXT2BYTE_Sensor;
-    *textPointer++ = ' ';
-    *textPointer++ = TXT_2BYTE;
-    *textPointer++ = TXT2BYTE_O2IFDigital;
-    *textPointer++ = '1' + activeSensorId;
-
-    snprintf(textPointer, 20,": %01.2f, %01.1f mV",  pStateReal->lifeData.ppO2Sensor_bar[activeSensorId], pStateReal->lifeData.sensorVoltage_mV[activeSensorId]);
-
-    tInfo_write_content_simple(  30, 770, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
-
-    tInfo_write_buttonTextline_simple(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,0);
+	switch(pStateReal->lifeData.extIf_sensor_map[activeSensorId])
+	{
+		default:
+		case SENSOR_DIGO2M:	refreshInfo_SensorO2(s);
+			break;
+		case SENSOR_CO2M: refreshInfo_SensorCo2(s);
+			break;
+	}
 }
 
 void sendActionToInfoSensor(uint8_t sendAction)
@@ -220,16 +271,28 @@
 
     	case ACTION_BUTTON_ENTER:    	if(settingsGetPointer()->ppo2sensors_deactivated & (1 << (activeSensorId)))
 										{
+    										if(stateRealGetPointer()->lifeData.extIf_sensor_map[activeSensorId] == SENSOR_CO2M)
+    										{
+    											settingsGetPointer()->co2_sensor_active = 1;
+    										}
     										settingsGetPointer()->ppo2sensors_deactivated &= ~(uint8_t)(1 << (activeSensorId));
 											sensorActive = 1;
 										}
 										else
 										{
+											if(stateRealGetPointer()->lifeData.extIf_sensor_map[activeSensorId] == SENSOR_CO2M)
+											{
+    											settingsGetPointer()->co2_sensor_active = 0;
+    										}
 											settingsGetPointer()->ppo2sensors_deactivated |= (uint8_t)(1 << (activeSensorId));
 											sensorActive = 0;
 										}
     		break;
-		case ACTION_BUTTON_NEXT:
+		case ACTION_BUTTON_NEXT:		if(stateRealGetPointer()->lifeData.extIf_sensor_map[activeSensorId] == SENSOR_CO2M)
+										{
+											DataEX_setExtInterface_Cmd(EXT_INTERFACE_CO2_CALIB);
+										}
+			break;
 		case ACTION_TIMEOUT:
 		case ACTION_MODE_CHANGE:
 	    case ACTION_IDLE_TICK:
--- a/Discovery/Src/tMenuEditHardware.c	Wed Oct 11 17:49:19 2023 +0200
+++ b/Discovery/Src/tMenuEditHardware.c	Sun Nov 05 20:19:08 2023 +0100
@@ -389,9 +389,9 @@
 	{
 		memcpy(pSettings->ext_sensor_map, pStateReal->lifeData.extIf_sensor_map, EXT_INTERFACE_SENSOR_CNT);
 		pSettings->ppo2sensors_deactivated = 0x0;	/* deactivation will be done by openEditO2Sensor if need */
-
+		pSettings->co2_sensor_active = 0;
 		pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_OPTIC;
-		for(index = 0; index < 3; index++)
+		for(index = 0; index < EXT_INTERFACE_SENSOR_CNT - 1; index++)
 		{
 				switch(pSettings->ext_sensor_map[index])
 				{
@@ -415,6 +415,9 @@
 											pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_DIGITAL;
 										}
 									break;
+					case SENSOR_CO2:
+					case SENSOR_CO2M:	pSettings->co2_sensor_active = 1;
+						break;
 #ifdef ENABLE_SENTINEL_MODE
 					case SENSOR_SENTINEL:	pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_SENTINEL;
 									break;
@@ -524,15 +527,15 @@
 		write_label_var(  30, 340, ME_Y_LINE6, &FontT48, strSensorId);
    	}
 
-	if((pSettings->ext_sensor_map[0] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[0] < SENSOR_TYPE_O2_END))
+	if((pSettings->ext_sensor_map[0] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[0] < SENSOR_MUX))
 	{
 		tMenuEdit_refresh_field(StMHARD3_O2_Sensor1);
 	}
-	if((pSettings->ext_sensor_map[1] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[1] < SENSOR_TYPE_O2_END))
+	if((pSettings->ext_sensor_map[1] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[1] < SENSOR_MUX))
 	{
 		tMenuEdit_refresh_field(StMHARD3_O2_Sensor2);
 	}
-	if((pSettings->ext_sensor_map[2] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[2] < SENSOR_TYPE_O2_END))
+	if((pSettings->ext_sensor_map[2] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[2] < SENSOR_MUX))
 	{
 		tMenuEdit_refresh_field(StMHARD3_O2_Sensor3);
 	}
@@ -570,7 +573,7 @@
 		}
 	}
 
-	if(((pSettings->ext_sensor_map[0] < SENSOR_OPTIC) || (pSettings->ext_sensor_map[0] >= SENSOR_TYPE_O2_END)))
+	if(((pSettings->ext_sensor_map[0] < SENSOR_OPTIC) || (pSettings->ext_sensor_map[0] >= SENSOR_MUX)))
 	{
 		pSettings->ppo2sensors_deactivated |= 1;
 	}
@@ -578,7 +581,7 @@
 	{
 		write_field_on_off(StMHARD3_O2_Sensor1,	 30, 95, ME_Y_LINE1,  &FontT48, "", sensorActive[0]);
 	}
-	if(((pSettings->ext_sensor_map[1] < SENSOR_OPTIC) || (pSettings->ext_sensor_map[1] >= SENSOR_TYPE_O2_END)))
+	if(((pSettings->ext_sensor_map[1] < SENSOR_OPTIC) || (pSettings->ext_sensor_map[1] >= SENSOR_MUX)))
 	{
 		pSettings->ppo2sensors_deactivated |= 2;
 	}
@@ -586,7 +589,7 @@
 	{
 		 write_field_on_off(StMHARD3_O2_Sensor2,	 30, 95, ME_Y_LINE2,  &FontT48, "", sensorActive[1]);
 	}
-	if(((pSettings->ext_sensor_map[2] < SENSOR_OPTIC) || (pSettings->ext_sensor_map[2] >= SENSOR_TYPE_O2_END)))
+	if(((pSettings->ext_sensor_map[2] < SENSOR_OPTIC) || (pSettings->ext_sensor_map[2] >= SENSOR_MUX)))
 	{
 		pSettings->ppo2sensors_deactivated |= 4;
 	}
@@ -627,15 +630,15 @@
 		write_field_button(StMHARD3_Sensor_Detect,	 30, 800, ME_Y_LINE6,  &FontT48, text);
    	}
 
-    if((pSettings->ext_sensor_map[0] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[0] < SENSOR_TYPE_O2_END))
+    if((pSettings->ext_sensor_map[0] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[0] < SENSOR_MUX))
 	{
 			setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1);
 	}
-    if((pSettings->ext_sensor_map[1] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[1] < SENSOR_TYPE_O2_END))
+    if((pSettings->ext_sensor_map[1] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[1] < SENSOR_MUX))
 	{
 			setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2);
 	}
-    if((pSettings->ext_sensor_map[2] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[2] < SENSOR_TYPE_O2_END))
+    if((pSettings->ext_sensor_map[2] >= SENSOR_OPTIC) && (pSettings->ext_sensor_map[2] < SENSOR_MUX))
 	{
 			setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3);
 	}
@@ -661,7 +664,7 @@
 {
 	const SDiveState *pStateReal = stateRealGetPointer();
 
-	if(pStateReal->lifeData.extIf_sensor_map[0] == SENSOR_DIGO2M)
+	if((pStateReal->lifeData.extIf_sensor_map[0] == SENSOR_DIGO2M) || (pStateReal->lifeData.extIf_sensor_map[0] == SENSOR_CO2M))
 	{
 		return EXIT_TO_INFO_SENSOR;
 	}
@@ -687,7 +690,7 @@
 {
 	const SDiveState *pStateReal = stateRealGetPointer();
 
-	if(pStateReal->lifeData.extIf_sensor_map[1] == SENSOR_DIGO2M)
+	if((pStateReal->lifeData.extIf_sensor_map[1] == SENSOR_DIGO2M) || (pStateReal->lifeData.extIf_sensor_map[1] == SENSOR_CO2M))
 	{
 		return EXIT_TO_INFO_SENSOR;
 	}
@@ -712,7 +715,7 @@
 {
 	const SDiveState *pStateReal = stateRealGetPointer();
 
-	if(pStateReal->lifeData.extIf_sensor_map[2] == SENSOR_DIGO2M)
+	if((pStateReal->lifeData.extIf_sensor_map[2] == SENSOR_DIGO2M) || (pStateReal->lifeData.extIf_sensor_map[2] == SENSOR_CO2M))
 	{
 		return EXIT_TO_INFO_SENSOR;
 	}
--- a/Discovery/Src/tMenuEditXtra.c	Wed Oct 11 17:49:19 2023 +0200
+++ b/Discovery/Src/tMenuEditXtra.c	Sun Nov 05 20:19:08 2023 +0100
@@ -54,9 +54,6 @@
 #ifdef ENABLE_PSCR_MODE
 static void openEdit_PSCR(void);
 #endif
-#ifdef ENABLE_CO2_SUPPORT
-static void openEdit_CO2Sensor(void);
-#endif
 
 /* Announced function prototypes -----------------------------------------------*/
 uint8_t OnAction_CompassHeading	(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
@@ -69,11 +66,6 @@
 static uint8_t OnAction_PSCRLungRation(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
 #endif
 
-#ifdef ENABLE_CO2_SUPPORT
-static uint8_t OnAction_CO2OnOff(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-static uint8_t OnAction_CO2Calib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action);
-#endif
-
 /* Exported functions --------------------------------------------------------*/
 
 
@@ -132,10 +124,6 @@
 			case 4: openEdit_PSCR();
 				break;
 #endif
-#ifdef ENABLE_CO2_SUPPORT
-			case 6: openEdit_CO2Sensor();
-				break;
-#endif
 			default:
 				break;
 		}
@@ -321,42 +309,6 @@
 }
 
 
-#ifdef ENABLE_CO2_SUPPORT
-static void openEdit_CO2Sensor()
-{
-    char text[32];
-
-    resetMenuEdit(CLUT_MenuPageXtra);
-
-    snprintf(text,32,"\001%c",TXT_CO2Sensor);
-    write_topline(text);
-
-    refresh_CO2Data();
-    if(settingsGetPointer()->co2_sensor_active)
-    {
-    	text[0] = '\005';
-    }
-    else
-    {
-        text[0] = '\006';
-    }
-    text[0] = TXT_CO2Sensor;
-    text[1] = 0;
-
-    write_field_on_off(StMXTRA_CO2_Sensor,	 30, 95, ME_Y_LINE3,  &FontT48, text, settingsGetPointer()->co2_sensor_active);
-
-   	text[0] = TXT_2BYTE;
-    text[1] = TXT2BYTE_O2Calib;
-    text[2] = 0;
-    write_field_button(StMXTRA_CO2_Sensor_Calib,30, 800, ME_Y_LINE4,  &FontT48, text);
-
-    setEvent(StMXTRA_CO2_Sensor,	(uint32_t)OnAction_CO2OnOff);
-    setEvent(StMXTRA_CO2_Sensor_Calib,	(uint32_t)OnAction_CO2Calib);
-
-    write_buttonTextline(TXT2BYTE_ButtonBack,TXT2BYTE_ButtonEnter,TXT2BYTE_ButtonNext);
-}
-#endif
-
 
 static uint8_t OnAction_CompassHeadingClear(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
 {
@@ -684,26 +636,4 @@
 }
 #endif
 
-#ifdef ENABLE_CO2_SUPPORT
-static uint8_t OnAction_CO2OnOff(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
-{
-	SSettings *pSettings = settingsGetPointer();
-	if(pSettings->co2_sensor_active)
-	{
-		pSettings->co2_sensor_active = 0;
-		tMenuEdit_set_on_off(StMXTRA_CO2_Sensor,0);
-	}
-	else
-	{
-		pSettings->co2_sensor_active = 1;
-		tMenuEdit_set_on_off(StMXTRA_CO2_Sensor,1);
-	}
-	return UPDATE_DIVESETTINGS;
-}
 
-static uint8_t OnAction_CO2Calib(uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
-{
-	DataEX_setExtInterface_Cmd(EXT_INTERFACE_CO2_CALIB);
-	return UPDATE_DIVESETTINGS;
-}
-#endif
--- a/Discovery/Src/tMenuHardware.c	Wed Oct 11 17:49:19 2023 +0200
+++ b/Discovery/Src/tMenuHardware.c	Sun Nov 05 20:19:08 2023 +0100
@@ -102,15 +102,14 @@
             sensorStatusColor[0] = '\020';
             sensorStatusColor[1] = '\020';
             sensorStatusColor[2] = '\020';
-            if(stateUsed->diveSettings.ppo2sensors_deactivated)
-            {
-                if(stateUsed->diveSettings.ppo2sensors_deactivated & 1)
+
+            if((stateUsed->diveSettings.ppo2sensors_deactivated & 1) || (data->ext_sensor_map[0] > SENSOR_DIGO2M))
                     sensorStatusColor[0] = '\031';
-                if(stateUsed->diveSettings.ppo2sensors_deactivated & 2)
+            if((stateUsed->diveSettings.ppo2sensors_deactivated & 2) || (data->ext_sensor_map[1] > SENSOR_DIGO2M))
                     sensorStatusColor[1] = '\031';
-                if(stateUsed->diveSettings.ppo2sensors_deactivated & 4)
+            if((stateUsed->diveSettings.ppo2sensors_deactivated & 4) || (data->ext_sensor_map[1] > SENSOR_DIGO2M))
                     sensorStatusColor[2] = '\031';
-            }
+
             textPointer += snprintf(&text[textPointer],20,"%c%01.1f  %c%01.1f  %c%01.1f\020"
                 ,sensorStatusColor[0], stateUsed->lifeData.ppO2Sensor_bar[0]
                 ,sensorStatusColor[1], stateUsed->lifeData.ppO2Sensor_bar[1]
--- a/Discovery/Src/tMenuXtra.c	Wed Oct 11 17:49:19 2023 +0200
+++ b/Discovery/Src/tMenuXtra.c	Sun Nov 05 20:19:08 2023 +0100
@@ -200,12 +200,6 @@
              }
         }
 #endif
-#ifdef ENABLE_CO2_SUPPORT
-        if((line == 0) || (line == 4))
-         {
-             textPointer += snprintf(&text[textPointer], 60, "%c", TXT_CO2Sensor);
-         }
-#endif
     }
     return StMXTRA;
 }