mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Sanity check on temperature values
The range is still very wide (as we get both air and water temperatures), but it will at least eliminate some completely bogus outliers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4297d931a3
commit
b5cd46aa39
1 changed files with 4 additions and 0 deletions
|
@ -354,6 +354,10 @@ static void temperature(char *buffer, void *_temperature)
|
|||
default:
|
||||
printf("Strange temperature reading %s\n", buffer);
|
||||
}
|
||||
/* temperatures outside -40C .. +70C should be ignored */
|
||||
if (temperature->mkelvin < ZERO_C_IN_MKELVIN - 40000 ||
|
||||
temperature->mkelvin > ZERO_C_IN_MKELVIN + 70000)
|
||||
temperature->mkelvin = 0;
|
||||
}
|
||||
|
||||
static void sampletime(char *buffer, void *_time)
|
||||
|
|
Loading…
Reference in a new issue