diff Discovery/Src/data_exchange_main.c @ 796:75ace7af8212

Expanded Sensor map structure: In the previous version the number of possible sensors were set to 5 based on the assumption that ADC slots are shared with digital O2 sensors. As result three of five slots would have been limited to O2 measurement usecase, leaving just two slots left for other sensors (e.g. CO2). In order to have as much flexibility (and less risk for data structure changes) the number of sensors has been set to 7 (3 ADC + 4 UART MUX)
author Ideenmodellierer
date Mon, 31 Jul 2023 20:00:06 +0200
parents 19ab6f3ed52a
children dd7ce655db26
line wrap: on
line diff
--- a/Discovery/Src/data_exchange_main.c	Mon Jul 31 19:50:36 2023 +0200
+++ b/Discovery/Src/data_exchange_main.c	Mon Jul 31 20:00:06 2023 +0200
@@ -397,7 +397,7 @@
 	dataOut.data.offsetTemperatureSensor_centiDegree = settings->offsetTemperature_centigrad;
 
 
-	memcpy(dataOut.data.externalInterface_SensorMap, settings->ext_sensor_map, 5);
+	memcpy(dataOut.data.externalInterface_SensorMap, settings->ext_sensor_map, EXT_INTERFACE_SENSOR_CNT);
 
 	memset(SensorActive, 0, sizeof(SensorActive));
 	for (index = 0; index < EXT_INTERFACE_SENSOR_CNT; index++)
@@ -406,7 +406,7 @@
 		{
 			case SENSOR_ANALOG:	SensorActive[SENSOR_ANALOG] = 1;
 				break;
-			case SENSOR_DIGO2:	SensorActive[SENSOR_DIGO2] = 1;
+			case SENSOR_DIGO2M:	SensorActive[SENSOR_DIGO2] = 1;
 				break;
 			case SENSOR_CO2:	SensorActive[SENSOR_CO2] = 1;
 				break;
@@ -977,7 +977,7 @@
 				}
 				else
 				{
-					if(dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].sensor_map[idx] == SENSOR_DIGO2)
+					if(dataIn.data[(dataIn.boolADCO2Data && DATA_BUFFER_ADC)].sensor_map[idx] == SENSOR_DIGO2M)
 					{
 						pStateReal->lifeData.ppO2Sensor_bar[idx] = pStateReal->lifeData.sensorVoltage_mV[idx] / 100.0;
 					}