comparison Discovery/Src/tInfoSensor.c @ 724:f285424f04d9

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.
author Ideenmodellierer
date Thu, 05 Jan 2023 18:30:06 +0100
parents 88f73b05d45c
children e33d661d1743
comparison
equal deleted inserted replaced
723:9b9ed5459d57 724:f285424f04d9
82 { 82 {
83 SSensorDataDiveO2* pDiveO2Data; 83 SSensorDataDiveO2* pDiveO2Data;
84 char text[31]; 84 char text[31];
85 uint8_t strIndex = 0; 85 uint8_t strIndex = 0;
86 86
87 float pressure = 0.0;
88
87 text[0] = '\001'; 89 text[0] = '\001';
88 text[1] = TXT_Sensor; 90 text[1] = TXT_Sensor;
89 text[2] = ' '; 91 text[2] = ' ';
90 text[3] = TXT_Information; 92 text[3] = TXT_Information;
91 text[4] = 0; 93 text[4] = 0;
100 uint64ToString(pDiveO2Data->sensorId,&text[strIndex]); 102 uint64ToString(pDiveO2Data->sensorId,&text[strIndex]);
101 } 103 }
102 tInfo_write_content_simple( 30, 340, ME_Y_LINE1, &FontT48, text, CLUT_Font020); 104 tInfo_write_content_simple( 30, 340, ME_Y_LINE1, &FontT48, text, CLUT_Font020);
103 snprintf(text,32,"%c: %02.1f",TXT_Temperature , (float)pDiveO2Data->temperature / 1000.0); 105 snprintf(text,32,"%c: %02.1f",TXT_Temperature , (float)pDiveO2Data->temperature / 1000.0);
104 tInfo_write_content_simple( 30, 340, ME_Y_LINE2, &FontT48, text, CLUT_Font020); 106 tInfo_write_content_simple( 30, 340, ME_Y_LINE2, &FontT48, text, CLUT_Font020);
107
108 #ifdef ENABLE_EXTERNAL_PRESSURE
109 pressure = (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[2]);
110 #else
111 pressure = (float)pDiveO2Data->pressure / 1000.0;
112 #endif
113 snprintf(text,32,"Druck: %02.1f (%02.1f)", (float)pDiveO2Data->pressure / 1000.0, pressure *1000.0);
114
115 tInfo_write_content_simple( 30, 340, ME_Y_LINE3, &FontT48, text, CLUT_Font020);
116 snprintf(text,32,"Feuchtigkeit: %02.1f", (float)pDiveO2Data->humidity / 1000.0);
117 tInfo_write_content_simple( 30, 340, ME_Y_LINE4, &FontT48, text, CLUT_Font020);
118 snprintf(text,32,"Status: 0x%lx", pDiveO2Data->status);
119 tInfo_write_content_simple( 30, 340, ME_Y_LINE5, &FontT48, text, CLUT_Font020);
120 snprintf(text,32,"Norm ppO2: %02.3f (%02.1f)", (float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0] / (pressure / 1000.0)),(float)(stateRealGetPointer()->lifeData.ppO2Sensor_bar[0]));
121 tInfo_write_content_simple( 30, 340, ME_Y_LINE6, &FontT48, text, CLUT_Font020);
105 } 122 }
106 123
107 void sendActionToInfoSensor(uint8_t sendAction) 124 void sendActionToInfoSensor(uint8_t sendAction)
108 { 125 {
109 126