comparison Discovery/Src/check_warning.c @ 563:d97f0e395058

Refine o2 sensor diagnostic functions: Changed implementation to ignore connection errors if analog interface is selected. Because the HUD is using cBars, the code has been modified to be compatible with the Bar units provided by the analog interface. Behavior (outofbounds) should be identical to the previous implementation.
author Ideenmodellierer
date Sun, 15 Nov 2020 20:01:56 +0100
parents 58200d756365
children 64bf41faab83
comparison
equal deleted inserted replaced
562:ec76fa85009e 563:d97f0e395058
175 pDiveState->warnings.sensorOutOfBounds[0] = 0; 175 pDiveState->warnings.sensorOutOfBounds[0] = 0;
176 pDiveState->warnings.sensorOutOfBounds[1] = 0; 176 pDiveState->warnings.sensorOutOfBounds[1] = 0;
177 pDiveState->warnings.sensorOutOfBounds[2] = 0; 177 pDiveState->warnings.sensorOutOfBounds[2] = 0;
178 178
179 if((pDiveState->diveSettings.diveMode == DIVEMODE_CCR) && (pDiveState->diveSettings.CCR_Mode == CCRMODE_Sensors)) 179 if((pDiveState->diveSettings.diveMode == DIVEMODE_CCR) && (pDiveState->diveSettings.CCR_Mode == CCRMODE_Sensors))
180 { 180
181 if(!get_HUD_battery_voltage_V()) 181 if(settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_OPTIC)
182 pDiveState->warnings.sensorLinkLost = 1; 182 {
183 183 {
184 test_HUD_sensor_values_outOfBounds(&pDiveState->warnings.sensorOutOfBounds[0], &pDiveState->warnings.sensorOutOfBounds[1], &pDiveState->warnings.sensorOutOfBounds[2]); 184 if(!get_HUD_battery_voltage_V())
185 185 pDiveState->warnings.sensorLinkLost = 1;
186 } 186 }
187 test_O2_sensor_values_outOfBounds(&pDiveState->warnings.sensorOutOfBounds[0], &pDiveState->warnings.sensorOutOfBounds[1], &pDiveState->warnings.sensorOutOfBounds[2]);
188 }
187 return pDiveState->warnings.sensorLinkLost 189 return pDiveState->warnings.sensorLinkLost
188 + pDiveState->warnings.sensorOutOfBounds[0] 190 + pDiveState->warnings.sensorOutOfBounds[0]
189 + pDiveState->warnings.sensorOutOfBounds[1] 191 + pDiveState->warnings.sensorOutOfBounds[1]
190 + pDiveState->warnings.sensorOutOfBounds[2]; 192 + pDiveState->warnings.sensorOutOfBounds[2];
191 } 193 }