comparison Discovery/Src/tCCR.c @ 744:dd5db6e2c9a4

Added DiveO2 fatal error detection: The digital sensor provides status information which are now considered in the sanity check for sensor values. The behavior in case of an error is the same as if an analog sensor would provide a out of bounce voltage.
author Ideenmodellierer
date Sun, 19 Feb 2023 21:51:19 +0100
parents 8adf9b8fc7fa
children 39ff186b6f98
comparison
equal deleted inserted replaced
743:6871d4b586ff 744:dd5db6e2c9a4
172 if(sensorNotActiveBinary & 4) 172 if(sensorNotActiveBinary & 4)
173 sensorActive[2] = 0; 173 sensorActive[2] = 0;
174 } 174 }
175 175
176 // test2: mV of remaining sensors 176 // test2: mV of remaining sensors
177 for(int i=0;i<3;i++) 177 for(index=0; index<3; index++)
178 { 178 {
179 sensorState[i] = sensorOK; 179 sensorState[index] = sensorOK;
180 180
181 if(sensorActive[i]) 181 if(sensorActive[index])
182 { 182 {
183 if( (stateUsed->lifeData.sensorVoltage_mV[i] < MIN_SENSOR_VOLTAGE_MV) || 183 if(((stateUsed->lifeData.extIf_sensor_map[index] == SENSOR_DIGO2) && (((SSensorDataDiveO2*)(stateUsed->lifeData.extIf_sensor_data))->status & DVO2_FATAL_ERROR))
184 (stateUsed->lifeData.sensorVoltage_mV[i] > MAX_SENSOR_VOLTAGE_MV)) 184 || ((stateUsed->lifeData.sensorVoltage_mV[index] < MIN_SENSOR_VOLTAGE_MV) || (stateUsed->lifeData.sensorVoltage_mV[index] > MAX_SENSOR_VOLTAGE_MV)))
185 { 185 {
186 sensorActive[i] = 0; 186 sensorActive[index] = 0;
187 switch(i) 187 switch(index)
188 { 188 {
189 case 0: 189 case 0:
190 sensorNotActiveBinary |= 1; 190 sensorNotActiveBinary |= 1;
191 break; 191 break;
192 case 1: 192 case 1:
193 sensorNotActiveBinary |= 2; 193 sensorNotActiveBinary |= 2;
194 break; 194 break;
195 case 2: 195 case 2:
196 sensorNotActiveBinary |= 4; 196 sensorNotActiveBinary |= 4;
197 break; 197 break;
198 } 198 }
199 } 199 }
200 } 200 }
201 } 201 }
202 202
203 *outOfBouds1 = 0; 203 *outOfBouds1 = 0;
204 *outOfBouds2 = 0; 204 *outOfBouds2 = 0;