# HG changeset patch # User Ideenmodellierer # Date 1672939806 -3600 # Node ID f285424f04d9a68dbdb99a72dfd367947c3247bc # Parent 9b9ed5459d57eb9aed73e566032a7b7d6d4998ad Development feature: external pressure sensor It now possible to use ADC channel 2 as channel for external pressure data. This function may be activated by compile switch only. It is usefull for sensor verification, e.g. by using a small pressure chamber. diff -r 9b9ed5459d57 -r f285424f04d9 Discovery/Src/tInfoSensor.c --- a/Discovery/Src/tInfoSensor.c Thu Jan 05 18:27:04 2023 +0100 +++ b/Discovery/Src/tInfoSensor.c Thu Jan 05 18:30:06 2023 +0100 @@ -84,6 +84,8 @@ char text[31]; uint8_t strIndex = 0; + float pressure = 0.0; + text[0] = '\001'; text[1] = TXT_Sensor; text[2] = ' '; @@ -102,6 +104,21 @@ tInfo_write_content_simple( 30, 340, 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, 340, 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, 340, ME_Y_LINE3, &FontT48, text, CLUT_Font020); + snprintf(text,32,"Feuchtigkeit: %02.1f", (float)pDiveO2Data->humidity / 1000.0); + tInfo_write_content_simple( 30, 340, ME_Y_LINE4, &FontT48, text, CLUT_Font020); + snprintf(text,32,"Status: 0x%lx", pDiveO2Data->status); + tInfo_write_content_simple( 30, 340, ME_Y_LINE5, &FontT48, text, CLUT_Font020); + 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, 340, ME_Y_LINE6, &FontT48, text, CLUT_Font020); } void sendActionToInfoSensor(uint8_t sendAction) diff -r 9b9ed5459d57 -r f285424f04d9 Discovery/Src/tMenuEditHardware.c --- a/Discovery/Src/tMenuEditHardware.c Thu Jan 05 18:27:04 2023 +0100 +++ b/Discovery/Src/tMenuEditHardware.c Thu Jan 05 18:30:06 2023 +0100 @@ -568,6 +568,13 @@ { if(pStateReal->lifeData.sensorVoltage_mV[loop] > 0.0001) /* sensor connected ?*/ { +#ifdef ENABLE_EXTERNAL_PRESSURE + if(loop == 2) + { + compensatedRef = pStateReal->lifeData.pressure_ambient_bar; + } +#endif + pSettings->ppo2sensors_calibCoeff[loop] = compensatedRef / pStateReal->lifeData.sensorVoltage_mV[loop]; } else