comparison Discovery/Src/check_warning.c @ 634:7c73f066cd16

Enable sensor check for Analog PPO2 mode: Checks which may trigger a fallback warning were not activated in previous versions. Beside enabling the checks the test logic has been changed. Before the change an avarage was build automatically using the remaining both sensors if one sensor failed. The scenario that also one of the remaining sensors may be out of bounds was not covered. The new implementation allows an out of bounds detection for all sensors in parallel. In that special case the last valid value will be used until the diver takes action (Fallback warning)
author Ideenmodellierer
date Wed, 24 Feb 2021 19:18:26 +0100
parents 64bf41faab83
children c47766ec3f96
comparison
equal deleted inserted replaced
633:68d95049f11a 634:7c73f066cd16
182 { 182 {
183 { 183 {
184 if(!get_HUD_battery_voltage_V()) 184 if(!get_HUD_battery_voltage_V())
185 pDiveState->warnings.sensorLinkLost = 1; 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 }
188 test_O2_sensor_values_outOfBounds(&pDiveState->warnings.sensorOutOfBounds[0], &pDiveState->warnings.sensorOutOfBounds[1], &pDiveState->warnings.sensorOutOfBounds[2]);
189 return pDiveState->warnings.sensorLinkLost 189 return pDiveState->warnings.sensorLinkLost
190 + pDiveState->warnings.sensorOutOfBounds[0] 190 + pDiveState->warnings.sensorOutOfBounds[0]
191 + pDiveState->warnings.sensorOutOfBounds[1] 191 + pDiveState->warnings.sensorOutOfBounds[1]
192 + pDiveState->warnings.sensorOutOfBounds[2]; 192 + pDiveState->warnings.sensorOutOfBounds[2];
193 } 193 }