# HG changeset patch # User Ideenmodellierer # Date 1606687091 -3600 # Node ID 9bb9a52d6ae5bad740281ba4feec1dc5ac8d6100 # Parent 1105cf7bbf6feb28d86e2166f52c01e30d689070 Handle o2 voltage values < 0.5mV as invalid: Values < 0.5mv will now be handled as ppo2 = 0Bar to avaid problems (e.g. by negativ values) in the decompression calculation. In the custom display sensors with low voltage are show using '-' diff -r 1105cf7bbf6f -r 9bb9a52d6ae5 Discovery/Inc/t7.h --- a/Discovery/Inc/t7.h Sun Nov 29 22:55:31 2020 +0100 +++ b/Discovery/Inc/t7.h Sun Nov 29 22:58:11 2020 +0100 @@ -61,6 +61,7 @@ void t7_change_field(void); void t7_change_customview(uint8_t action); +void t7_select_customview(uint8_t selectedCustomview); void t7_set_field_to_primary(void); void t7_set_customview_to_primary(void); diff -r 1105cf7bbf6f -r 9bb9a52d6ae5 Discovery/Src/data_exchange_main.c --- a/Discovery/Src/data_exchange_main.c Sun Nov 29 22:55:31 2020 +0100 +++ b/Discovery/Src/data_exchange_main.c Sun Nov 29 22:58:11 2020 +0100 @@ -102,6 +102,8 @@ #define UNKNOWN_DATE_MONTH 1 #define UNKNOWN_DATE_YEAR 16 +#define IGNORE_O2_VOLTAGE_LEVEL_MV (0.5f) + /* Private function prototypes -----------------------------------------------*/ static uint8_t DataEX_check_header_and_footer_ok(void); static uint8_t DataEX_check_header_and_footer_shifted(void); @@ -774,7 +776,7 @@ { SDiveState *pStateReal = stateRealGetPointerWrite(); static uint16_t getDeviceDataAfterStartOfMainCPU = 20; - + uint8_t idx; // wireless - �ltere daten aufr�umen #if 0 @@ -880,12 +882,20 @@ { if(pStateReal->data_old__lost_connection_to_slave == 0) { - pStateReal->lifeData.sensorVoltage_mV[0] = dataIn.data[0].extADC_voltage[0]; - pStateReal->lifeData.sensorVoltage_mV[1] = dataIn.data[0].extADC_voltage[1]; - pStateReal->lifeData.sensorVoltage_mV[2] = dataIn.data[0].extADC_voltage[2]; - pStateReal->lifeData.ppO2Sensor_bar[0] = pStateReal->lifeData.sensorVoltage_mV[0] * pSettings->ppo2sensors_calibCoeff[0]; - pStateReal->lifeData.ppO2Sensor_bar[1] = pStateReal->lifeData.sensorVoltage_mV[1] * pSettings->ppo2sensors_calibCoeff[1]; - pStateReal->lifeData.ppO2Sensor_bar[2] = pStateReal->lifeData.sensorVoltage_mV[2] * pSettings->ppo2sensors_calibCoeff[2]; + for(idx = 0; idx < 3; idx++) + { + pStateReal->lifeData.sensorVoltage_mV[idx] = dataIn.data[0].extADC_voltage[idx]; + if(pStateReal->lifeData.sensorVoltage_mV[idx] < IGNORE_O2_VOLTAGE_LEVEL_MV) + { + pStateReal->lifeData.sensorVoltage_mV[idx] = 0.0; + pStateReal->lifeData.ppO2Sensor_bar[idx] = 0; + } + else + { + pStateReal->lifeData.ppO2Sensor_bar[idx] = pStateReal->lifeData.sensorVoltage_mV[idx] * pSettings->ppo2sensors_calibCoeff[idx]; + } + + } } } diff -r 1105cf7bbf6f -r 9bb9a52d6ae5 Discovery/Src/t3.c --- a/Discovery/Src/t3.c Sun Nov 29 22:55:31 2020 +0100 +++ b/Discovery/Src/t3.c Sun Nov 29 22:58:11 2020 +0100 @@ -1029,7 +1029,7 @@ else if(i==2) text[textpointer++] = '\002'; /* right */ - if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<diveSettings.ppo2sensors_deactivated & (1<lifeData.ppO2Sensor_bar[i] == 0.0)) { text[textpointer++] = '\031'; text[textpointer++] = ' '; diff -r 1105cf7bbf6f -r 9bb9a52d6ae5 Discovery/Src/t7.c --- a/Discovery/Src/t7.c Sun Nov 29 22:55:31 2020 +0100 +++ b/Discovery/Src/t7.c Sun Nov 29 22:58:11 2020 +0100 @@ -1662,6 +1662,13 @@ selection_customview = *pViews; } +void t7_select_customview(uint8_t selectedCustomview) +{ + if(selectedCustomview < CVIEW_END) + { + selection_customview = selectedCustomview; + } +} uint8_t t7_get_length_of_customtext(void) { @@ -1976,7 +1983,7 @@ text[textpointer++] = '\030'; // main color for(int i=0;i<3;i++) { - if(stateUsed->diveSettings.ppo2sensors_deactivated & (1<diveSettings.ppo2sensors_deactivated & (1<lifeData.ppO2Sensor_bar[i] == 0.0)) { text[textpointer++] = '\031'; // labelcolor text[textpointer++] = '\001';