suppressed logging of invalid values in 1wire protocol
This commit is contained in:
parent
91145f4c83
commit
3490213877
1 changed files with 14 additions and 11 deletions
|
@ -57,6 +57,8 @@ reading_t onewire_get(void *handle) {
|
|||
char buffer[16];
|
||||
int bytes;
|
||||
|
||||
|
||||
do {
|
||||
rewind((FILE *) handle);
|
||||
bytes = fread(buffer, 1, 16, (FILE *) handle);
|
||||
|
||||
|
@ -66,6 +68,7 @@ reading_t onewire_get(void *handle) {
|
|||
rd.value = strtof(buffer, NULL);
|
||||
gettimeofday(&rd.tv, NULL);
|
||||
}
|
||||
} while (rd.value == 85) { /* skip invalid readings */
|
||||
|
||||
return rd;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue