Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb fix the relative humidity sensor



details:   https://anonhg.NetBSD.org/src/rev/29d26df8cb83
branches:  trunk
changeset: 752765:29d26df8cb83
user:      cnst <cnst%NetBSD.org@localhost>
date:      Sat Mar 06 04:39:16 2010 +0000

description:
fix the relative humidity sensor

diffstat:

 sys/dev/usb/uthum.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r edeafaf6ca28 -r 29d26df8cb83 sys/dev/usb/uthum.c
--- a/sys/dev/usb/uthum.c       Sat Mar 06 04:33:24 2010 +0000
+++ b/sys/dev/usb/uthum.c       Sat Mar 06 04:39:16 2010 +0000
@@ -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:



Home | Main Index | Thread Index | Old Index