diff options
| author | kiyohara <kiyohara@NetBSD.org> | 2006-06-12 16:07:33 +0000 |
|---|---|---|
| committer | kiyohara <kiyohara@NetBSD.org> | 2006-06-12 16:07:33 +0000 |
| commit | 19d35b313547d8dabec5bf7ea20f1fed2800a181 (patch) | |
| tree | 3b5ef1776e9b346640b108629f1b61dd09f80e64 | |
| parent | 34440af2fcae6a9347d4a325e63db0986a2fdd2a (diff) | |
It necessary to mask to validate bits.
| -rw-r--r-- | sys/dev/i2c/lm75.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/i2c/lm75.c b/sys/dev/i2c/lm75.c index c5ec22c4ff6..c2f2c7cec4d 100644 --- a/sys/dev/i2c/lm75.c +++ b/sys/dev/i2c/lm75.c @@ -1,4 +1,4 @@ -/* $NetBSD: lm75.c,v 1.9 2006/05/17 00:10:54 kiyohara Exp $ */ +/* $NetBSD: lm75.c,v 1.10 2006/06/12 16:07:33 kiyohara Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -326,7 +326,7 @@ lmtemp_decode_lm77(const uint8_t *buf) * D11 - D3 : Bit8(MSB) - Bit0 */ temp = (int8_t)buf[0]; - temp = (temp << 5) | (buf[1] >> 3); + temp = (temp << 5) | ((buf[1] >> 3) & 0x1f); /* Temp is given in 1/2 deg. C, we convert to uK. */ val = temp * 500000 + 273150000; |
