2006-06-18 00:41:10 +02:00
|
|
|
|
|
|
|
#include "dev/pir-sensor.h"
|
|
|
|
|
|
|
|
const struct sensors_sensor pir_sensor;
|
|
|
|
|
|
|
|
static int pir_value;
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
void
|
|
|
|
pir_sensor_changed(int strength)
|
|
|
|
{
|
|
|
|
pir_value += strength;
|
|
|
|
sensors_changed(&pir_sensor);
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
2011-12-19 13:50:50 +01:00
|
|
|
static int
|
2006-06-18 00:41:10 +02:00
|
|
|
value(int type)
|
|
|
|
{
|
|
|
|
return pir_value;
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
static int
|
2011-12-19 13:50:50 +01:00
|
|
|
configure(int type, int c)
|
2006-06-18 00:41:10 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
2011-12-19 13:50:50 +01:00
|
|
|
static int
|
2006-06-18 00:41:10 +02:00
|
|
|
status(int type)
|
|
|
|
{
|
2011-12-19 13:50:50 +01:00
|
|
|
return 0;
|
2006-06-18 00:41:10 +02:00
|
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*/
|
|
|
|
SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
|
|
|
|
value, configure, status);
|