diff --git a/core/dev/sht11-sensor.c b/core/dev/sht11-sensor.c index f9834a1c2..fa0738cb2 100644 --- a/core/dev/sht11-sensor.c +++ b/core/dev/sht11-sensor.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: sht11-sensor.c,v 1.1 2010/01/14 20:16:33 adamdunkels Exp $ + * @(#)$Id: sht11-sensor.c,v 1.2 2010/01/15 08:51:21 adamdunkels Exp $ */ #include @@ -59,7 +59,10 @@ value(int type) /* Total Solar Radiation. */ case SHT11_SENSOR_HUMIDITY: return sht11_humidity(); - } + + case SHT11_SENSOR_BATTERY_INDICATOR: + return sht11_sreg() & 0x40? 1: 0; +} return 0; } /*---------------------------------------------------------------------------*/ @@ -76,7 +79,7 @@ status(int type) /*---------------------------------------------------------------------------*/ static int -configure(int type, void *c) +configure(int type, int c) { switch(type) { case SENSORS_ACTIVE: diff --git a/core/dev/sht11-sensor.h b/core/dev/sht11-sensor.h index f09e7908e..6618a3877 100644 --- a/core/dev/sht11-sensor.h +++ b/core/dev/sht11-sensor.h @@ -27,14 +27,14 @@ * SUCH DAMAGE. * * - * $Id: sht11-sensor.h,v 1.1 2010/01/14 20:16:33 adamdunkels Exp $ + * $Id: sht11-sensor.h,v 1.2 2010/01/15 08:51:21 adamdunkels Exp $ * * ----------------------------------------------------------------- * * Author : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : 2010-01-08 - * Updated : $Date: 2010/01/14 20:16:33 $ - * $Revision: 1.1 $ + * Updated : $Date: 2010/01/15 08:51:21 $ + * $Revision: 1.2 $ */ #ifndef __SHT11_SENSOR_H__ @@ -44,8 +44,9 @@ extern const struct sensors_sensor sht11_sensor; -#define SHT11_SENSOR_TEMP 0 -#define SHT11_SENSOR_HUMIDITY 1 +#define SHT11_SENSOR_TEMP 0 +#define SHT11_SENSOR_HUMIDITY 1 +#define SHT11_SENSOR_BATTERY_INDICATOR 2 #endif /* __SHT11-SENSOR_H__ */