Module Name:    src
Committed By:   brad
Date:           Fri Oct 29 23:23:33 UTC 2021

Modified Files:
        src/sys/dev/i2c: sht4x.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/sht4x.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/sht4x.c
diff -u src/sys/dev/i2c/sht4x.c:1.1 src/sys/dev/i2c/sht4x.c:1.2
--- src/sys/dev/i2c/sht4x.c:1.1	Sun Oct  3 17:27:02 2021
+++ src/sys/dev/i2c/sht4x.c	Fri Oct 29 23:23:33 2021
@@ -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 <b...@anduin.eldar.org>
@@ -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 @@ sht4x_refresh(struct sysmon_envsys * sme
 
 	  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 @@ sht4x_refresh(struct sysmon_envsys * sme
 		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;

Reply via email to