Module Name:    src
Committed By:   cnst
Date:           Sat Mar  6 04:39:16 UTC 2010

Modified Files:
        src/sys/dev/usb: uthum.c

Log Message:
fix the relative humidity sensor


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/uthum.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/usb/uthum.c
diff -u src/sys/dev/usb/uthum.c:1.2 src/sys/dev/usb/uthum.c:1.3
--- src/sys/dev/usb/uthum.c:1.2	Wed Feb 24 17:34:56 2010
+++ src/sys/dev/usb/uthum.c	Sat Mar  6 04:39:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uthum.c,v 1.2 2010/02/24 17:34:56 plunky Exp $   */
+/*	$NetBSD: uthum.c,v 1.3 2010/03/06 04:39:16 cnst Exp $   */
 /*	$OpenBSD: uthum.c,v 1.6 2010/01/03 18:43:02 deraadt Exp $   */
 
 /*
@@ -167,7 +167,8 @@
 		sc->sc_sensor[UTHUM_TEMP].units = ENVSYS_STEMP;
 		sc->sc_sensor[UTHUM_TEMP].state = ENVSYS_SINVALID;
 
-		(void)strlcpy(sc->sc_sensor[UTHUM_HUMIDITY].desc, "humidity",
+		(void)strlcpy(sc->sc_sensor[UTHUM_HUMIDITY].desc,
+		    "relative humidity",
 		    sizeof(sc->sc_sensor[UTHUM_HUMIDITY].desc));
 		sc->sc_sensor[UTHUM_HUMIDITY].units = ENVSYS_INTEGER;
 		sc->sc_sensor[UTHUM_HUMIDITY].value_cur = 0;
@@ -346,7 +347,7 @@
 		temp = uthum_sht1x_temp(temp_tick);
 		rh = uthum_sht1x_rh(humidity_tick, temp);
 
-		sc->sc_sensor[UTHUM_HUMIDITY].value_cur = rh;
+		sc->sc_sensor[UTHUM_HUMIDITY].value_cur = rh / 1000;
 		sc->sc_sensor[UTHUM_HUMIDITY].state = ENVSYS_SVALID;
 		break;
 	case UTHUM_TYPE_TEMPER:

Reply via email to