# HG changeset patch # User Ideenmodellierer # Date 1676839879 -3600 # Node ID dd5db6e2c9a4b2a98e29dbb6945a5c783cccd744 # Parent 6871d4b586ffaf5e44e2a05b03d54af769310168 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. diff -r 6871d4b586ff -r dd5db6e2c9a4 Discovery/Src/tCCR.c --- a/Discovery/Src/tCCR.c Sun Feb 19 21:48:47 2023 +0100 +++ b/Discovery/Src/tCCR.c Sun Feb 19 21:51:19 2023 +0100 @@ -174,29 +174,29 @@ } // test2: mV of remaining sensors - for(int i=0;i<3;i++) + for(index=0; index<3; index++) { - sensorState[i] = sensorOK; + sensorState[index] = sensorOK; - if(sensorActive[i]) + if(sensorActive[index]) { - if( (stateUsed->lifeData.sensorVoltage_mV[i] < MIN_SENSOR_VOLTAGE_MV) || - (stateUsed->lifeData.sensorVoltage_mV[i] > MAX_SENSOR_VOLTAGE_MV)) - { - sensorActive[i] = 0; - switch(i) - { - case 0: - sensorNotActiveBinary |= 1; - break; - case 1: - sensorNotActiveBinary |= 2; - break; - case 2: - sensorNotActiveBinary |= 4; - break; - } - } + if(((stateUsed->lifeData.extIf_sensor_map[index] == SENSOR_DIGO2) && (((SSensorDataDiveO2*)(stateUsed->lifeData.extIf_sensor_data))->status & DVO2_FATAL_ERROR)) + || ((stateUsed->lifeData.sensorVoltage_mV[index] < MIN_SENSOR_VOLTAGE_MV) || (stateUsed->lifeData.sensorVoltage_mV[index] > MAX_SENSOR_VOLTAGE_MV))) + { + sensorActive[index] = 0; + switch(index) + { + case 0: + sensorNotActiveBinary |= 1; + break; + case 1: + sensorNotActiveBinary |= 2; + break; + case 2: + sensorNotActiveBinary |= 4; + break; + } + } } }