Mercurial > public > ostc4
comparison Discovery/Src/data_exchange_main.c @ 702:6d7c812fc173
Added digital o2 sensor to settings and data exchange:
Added functionality to pass the o2 signals from a digital sensor (via UART)
author | Ideenmodellierer |
---|---|
date | Fri, 28 Oct 2022 20:29:37 +0200 |
parents | 52d68cf9994c |
children | 74cfd91199bd |
comparison
equal
deleted
inserted
replaced
701:8c48553a0176 | 702:6d7c812fc173 |
---|---|
391 dataOut.data.offsetPressureSensor_mbar = settings->offsetPressure_mbar; | 391 dataOut.data.offsetPressureSensor_mbar = settings->offsetPressure_mbar; |
392 dataOut.data.offsetTemperatureSensor_centiDegree = settings->offsetTemperature_centigrad; | 392 dataOut.data.offsetTemperatureSensor_centiDegree = settings->offsetTemperature_centigrad; |
393 | 393 |
394 | 394 |
395 | 395 |
396 if(settings->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) | 396 if((settings->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) || (settings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG)) |
397 { | 397 { |
398 externalInterface_Cmd |= EXT_INTERFACE_ADC_ON | EXT_INTERFACE_33V_ON; | 398 externalInterface_Cmd |= EXT_INTERFACE_ADC_ON | EXT_INTERFACE_33V_ON; |
399 } | |
400 | |
401 if((settings->ppo2sensors_source == O2_SENSOR_SOURCE_DIGITAL) || (settings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG)) | |
402 { | |
403 externalInterface_Cmd |= EXT_INTERFACE_33V_ON | EXT_INTERFACE_UART_O2; | |
399 } | 404 } |
400 | 405 |
401 #ifdef ENABLE_SENTINEL_MODE | 406 #ifdef ENABLE_SENTINEL_MODE |
402 if(settings->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) | 407 if(settings->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL) |
403 { | 408 { |
945 pStateReal->lifeData.sensorVoltage_mV[idx] = 0.0; | 950 pStateReal->lifeData.sensorVoltage_mV[idx] = 0.0; |
946 pStateReal->lifeData.ppO2Sensor_bar[idx] = 0; | 951 pStateReal->lifeData.ppO2Sensor_bar[idx] = 0; |
947 } | 952 } |
948 else | 953 else |
949 { | 954 { |
950 pStateReal->lifeData.ppO2Sensor_bar[idx] = pStateReal->lifeData.sensorVoltage_mV[idx] * pSettings->ppo2sensors_calibCoeff[idx]; | 955 if((idx == 0) && ((pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_DIGITAL) || (pSettings->ppo2sensors_source == O2_SENSOR_SOURCE_ANADIG))) |
956 { | |
957 pStateReal->lifeData.ppO2Sensor_bar[idx] = pStateReal->lifeData.sensorVoltage_mV[idx] / 100.0; | |
958 } | |
959 else | |
960 { | |
961 pStateReal->lifeData.ppO2Sensor_bar[idx] = pStateReal->lifeData.sensorVoltage_mV[idx] * pSettings->ppo2sensors_calibCoeff[idx]; | |
962 } | |
951 } | 963 } |
952 | 964 |
953 } | 965 } |
954 } | 966 } |
955 } | 967 } |