changeset 746:7e84ae1513b6

Code cleanup sensors under development: Deactivated compile option for Sentinel and CO2 sensor. Added missing compile switches.
author Ideenmodellierer
date Tue, 21 Feb 2023 21:19:31 +0100
parents b392524753fb
children df0d43da1614
files Common/Inc/configuration.h Discovery/Src/tMenuEditHardware.c Small_CPU/Src/externalInterface.c
diffstat 3 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Common/Inc/configuration.h	Sun Feb 19 21:52:02 2023 +0100
+++ b/Common/Inc/configuration.h	Tue Feb 21 21:19:31 2023 +0100
@@ -64,7 +64,7 @@
 #define ENABLE_PSCR_MODE
 
 /* Enable to have CO2 sensor functionality available */
-#define ENABLE_CO2_SUPPORT
+/* #define ENABLE_CO2_SUPPORT */
 
 /* Enable to have Sentinel rebreather interface available */
 /* #define ENABLE_SENTINEL_MODE */
--- a/Discovery/Src/tMenuEditHardware.c	Sun Feb 19 21:52:02 2023 +0100
+++ b/Discovery/Src/tMenuEditHardware.c	Tue Feb 21 21:19:31 2023 +0100
@@ -327,8 +327,10 @@
 											pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_DIGITAL;
 										}
 									break;
+#ifdef ENABLE_SENTINEL_MODE
 					case SENSOR_SENTINEL:	pSettings->ppo2sensors_source = O2_SENSOR_SOURCE_SENTINEL;
 									break;
+#endif
 					default:
 									break;
 				}
@@ -418,7 +420,11 @@
 		}
 		else
 		{
-			if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG)|| (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL))
+			if((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG)
+#ifdef ENABLE_CO2_SUPPORT
+					|| (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL)
+#endif
+					)
 			{
 				strSensorId[0] = TXT_2BYTE;
 				strSensorId[1] = TXT2BYTE_O2Calib;
@@ -473,7 +479,7 @@
 {
 	SSettings *pSettings = settingsGetPointer();
     uint8_t sensorActive[3];
-    uint8_t text[3];
+    char text[3];
 
     set_globalState(StMHARD3_Sensors);
 	resetMenuEdit(CLUT_MenuPageHardware);
--- a/Small_CPU/Src/externalInterface.c	Sun Feb 19 21:52:02 2023 +0100
+++ b/Small_CPU/Src/externalInterface.c	Tue Feb 21 21:19:31 2023 +0100
@@ -314,9 +314,14 @@
 		case (EXT_INTERFACE_UART_CO2 >> 8):
 		case (EXT_INTERFACE_UART_O2 >> 8):
 		case (EXT_INTERFACE_UART_SENTINEL >> 8):
-				if((externalAutoDetect <= DETECTION_START) || ((protocol == EXT_INTERFACE_UART_CO2 >> 8) && (externalAutoDetect == DETECTION_CO2))
-														   || ((protocol == EXT_INTERFACE_UART_O2 >> 8) && (externalAutoDetect == DETECTION_DIGO2))
-														   || ((protocol == EXT_INTERFACE_UART_SENTINEL >> 8) && (externalAutoDetect == DETECTION_SENTINEL)))
+				if((externalAutoDetect <= DETECTION_START) || ((protocol == EXT_INTERFACE_UART_O2 >> 8) && (externalAutoDetect == DETECTION_DIGO2))
+#ifdef ENABLE_CO2_SUPPORT
+															|| ((protocol == EXT_INTERFACE_UART_CO2 >> 8) && (externalAutoDetect == DETECTION_CO2))
+#endif
+#ifdef ENABLE_SENTINEL_MODE
+														   || ((protocol == EXT_INTERFACE_UART_SENTINEL >> 8) && (externalAutoDetect == DETECTION_SENTINEL))
+#endif
+					)
 				{
 					sensorDataId = 0;
 					externalUART_Protocol = protocol;