diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-12-27 23:03:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-12-27 23:03:05 +0000 |
commit | 406aec122bd067b52c8745f319fbc63b266744bf (patch) | |
tree | a31d7cf422307c51d016f5379be769d129793ca0 | |
parent | f50d2de7a66b93911ba99655c875f1347c423430 (diff) |
correctly mark 0x7f temperature reading as invalid
-rw-r--r-- | sys/dev/i2c/adm1021.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/i2c/adm1021.c b/sys/dev/i2c/adm1021.c index b6f77c837da..99d54f89c7e 100644 --- a/sys/dev/i2c/adm1021.c +++ b/sys/dev/i2c/adm1021.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adm1021.c,v 1.14 2005/12/27 22:55:50 deraadt Exp $ */ +/* $OpenBSD: adm1021.c,v 1.15 2005/12/27 23:03:04 deraadt Exp $ */ /* * Copyright (c) 2005 Theo de Raadt @@ -146,7 +146,7 @@ admtemp_refresh(void *arg) if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, &cmd, sizeof cmd, &sdata, sizeof sdata, I2C_F_POLL) == 0) { if (sdata == 0x7f) { - sc->sc_sensor[ADMTEMP_EXT].flags &= ~SENSOR_FINVALID; + sc->sc_sensor[ADMTEMP_EXT].flags |= SENSOR_FINVALID; } else { sc->sc_sensor[ADMTEMP_EXT].value = 273150000 + 1000000 * sdata; @@ -159,7 +159,7 @@ admtemp_refresh(void *arg) if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, &cmd, sizeof cmd, &sdata, sizeof sdata, I2C_F_POLL) == 0) { if (sdata == 0x7f) { - sc->sc_sensor[ADMTEMP_INT].flags &= ~SENSOR_FINVALID; + sc->sc_sensor[ADMTEMP_INT].flags |= SENSOR_FINVALID; } else { sc->sc_sensor[ADMTEMP_INT].value = 273150000 + 1000000 * sdata; @@ -167,7 +167,7 @@ admtemp_refresh(void *arg) } } } else - sc->sc_sensor[ADMTEMP_INT].flags &= ~SENSOR_FINVALID; + sc->sc_sensor[ADMTEMP_INT].flags |= SENSOR_FINVALID; iic_release_bus(sc->sc_tag, 0); } |