Contiki 2.6

pir-sensor.c

00001 
00002 #include "dev/pir-sensor.h"
00003 
00004 const struct sensors_sensor pir_sensor;
00005 
00006 static int pir_value;
00007 
00008 /*---------------------------------------------------------------------------*/
00009 void
00010 pir_sensor_changed(int strength)
00011 {
00012   pir_value += strength;
00013   sensors_changed(&pir_sensor);
00014 }
00015 /*---------------------------------------------------------------------------*/
00016 static int
00017 value(int type)
00018 {
00019   return pir_value;
00020 }
00021 /*---------------------------------------------------------------------------*/
00022 static int
00023 configure(int type, int c)
00024 {
00025   return 0;
00026 }
00027 /*---------------------------------------------------------------------------*/
00028 static int
00029 status(int type)
00030 {
00031   return 0;
00032 }
00033 /*---------------------------------------------------------------------------*/
00034 SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
00035                value, configure, status);