# HG changeset patch # User Ideenmodellierer # Date 1598291968 -7200 # Node ID 5757edda56b7815b2b02960dd9920a26a1eb6fd2 # Parent 9623f166b0c0e2ae70adf204c3004d11f67fa7df Added worst case plausibility check (disabled by compile switch) Just used in case of development activities which may cause negativ values resulting in errors / timeout in the deco calculation diff -r 9623f166b0c0 -r 5757edda56b7 Discovery/Src/data_exchange_main.c --- a/Discovery/Src/data_exchange_main.c Mon Aug 24 19:53:27 2020 +0200 +++ b/Discovery/Src/data_exchange_main.c Mon Aug 24 19:59:28 2020 +0200 @@ -732,6 +732,17 @@ surface = d->data[d->boolPressureData].surface_mbar / 1000.0f; density = ((float)( 100 + settingsGetPointer()->salinity)) / 100.0f; +#ifdef TESTBENCH + /* do plausibility check (typically only needed at debug hardware) */ + if(ambient < 0) + { + ambient = 1.0; + } + if(surface < 0) + { + surface = 1.0; + } +#endif ds->lifeData.pressure_ambient_bar = ambient; ds->lifeData.pressure_surface_bar = surface; depth = (ambient - surface) / (0.09807f * density); @@ -745,6 +756,13 @@ float temp = 0; temp = d->data[d->boolPressureData].temperature; +#ifdef TESTBENCH + /* do plausibility check (typically only needed at debug hardware */ + if(temp < -40.0) + { + temp = 20.0; + } +#endif return temp; }