Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c Correct an off by one degree error in the temper...



details:   https://anonhg.NetBSD.org/src/rev/952aebad8adb
branches:  trunk
changeset: 990534:952aebad8adb
user:      brad <brad%NetBSD.org@localhost>
date:      Fri Oct 29 23:23:33 2021 +0000

description:
Correct an off by one degree error in the temperature conversion.

diffstat:

 sys/dev/i2c/sht4x.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 7a1f81b3b5c2 -r 952aebad8adb sys/dev/i2c/sht4x.c
--- a/sys/dev/i2c/sht4x.c       Fri Oct 29 23:03:53 2021 +0000
+++ b/sys/dev/i2c/sht4x.c       Fri Oct 29 23:23:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sht4x.c,v 1.1 2021/10/03 17:27:02 brad Exp $   */
+/*     $NetBSD: sht4x.c,v 1.2 2021/10/29 23:23:33 brad Exp $   */
 
 /*
  * Copyright (c) 2021 Brad Spencer <brad%anduin.eldar.org@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sht4x.c,v 1.1 2021/10/03 17:27:02 brad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sht4x.c,v 1.2 2021/10/29 23:23:33 brad Exp $");
 
 /*
   Driver for the Sensirion SHT40/SHT41/SHT45
@@ -723,7 +723,7 @@
 
          It follows then:
 
-         T in Kelvin = (229.15 + 175 * rawvalue / 65535)
+         T in Kelvin = (228.15 + 175 * rawvalue / 65535)
 
          given the relationship between Celsius and Kelvin.
 
@@ -771,7 +771,7 @@
                switch (edata->sensor) {
                case SHT4X_TEMP_SENSOR:
                        svalptr = &rawdata[0];
-                       v1 = 22915; /* this is scaled up already from 229.15 */
+                       v1 = 22815; /* this is scaled up already from 228.15 */
                        v2 = 175;
                        mul1 = 10000000000;
                        mul2 = 100000000;



Home | Main Index | Thread Index | Old Index