Updated to match the new sensors API

This commit is contained in:
adamdunkels 2010-01-14 15:38:56 +00:00
parent dd6922906c
commit fe126bc90e
7 changed files with 7 additions and 205 deletions

View File

@ -10,33 +10,6 @@ button_press(void)
sensors_changed(&button_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init(void)
{
}
/*---------------------------------------------------------------------------*/
static int
irq(void)
{
return 0;
}
/*---------------------------------------------------------------------------*/
static void
activate(void)
{
}
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
}
/*---------------------------------------------------------------------------*/
static int
active(void)
{
return 1;
}
/*---------------------------------------------------------------------------*/
static unsigned int
value(int type)
{
@ -56,5 +29,4 @@ status(int type)
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
init, irq, activate, deactivate, active,
value, configure, status);

View File

@ -13,33 +13,6 @@ pir_sensor_changed(int strength)
sensors_changed(&pir_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init(void)
{
}
/*---------------------------------------------------------------------------*/
static int
irq(void)
{
return 0;
}
/*---------------------------------------------------------------------------*/
static void
activate(void)
{
}
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
}
/*---------------------------------------------------------------------------*/
static int
active(void)
{
return 1;
}
/*---------------------------------------------------------------------------*/
static unsigned int
value(int type)
{
@ -59,5 +32,4 @@ status(int type)
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
init, irq, activate, deactivate, active,
value, configure, status);

View File

@ -29,14 +29,14 @@
* This file is part of the Configurable Sensor Network Application
* Architecture for sensor nodes running the Contiki operating system.
*
* $Id: vib-sensor.c,v 1.1 2006/06/17 22:41:31 adamdunkels Exp $
* $Id: vib-sensor.c,v 1.2 2010/01/14 15:38:56 adamdunkels Exp $
*
* -----------------------------------------------------------------
*
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
* Created : 2005-11-01
* Updated : $Date: 2006/06/17 22:41:31 $
* $Revision: 1.1 $
* Updated : $Date: 2010/01/14 15:38:56 $
* $Revision: 1.2 $
*/
#include "dev/vib-sensor.h"
@ -51,36 +51,6 @@ vib_sensor_changed(void)
sensors_changed(&vib_sensor);
}
/*---------------------------------------------------------------------------*/
static int
irq(void)
{
return 0;
}
/*---------------------------------------------------------------------------*/
static void
init(void)
{
vib = 0;
}
/*---------------------------------------------------------------------------*/
static void
activate(void)
{
vib = 1;
}
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
vib = 0;
}
/*---------------------------------------------------------------------------*/
static int
active(void)
{
return vib;
}
/*---------------------------------------------------------------------------*/
static unsigned int
value(int type)
{
@ -100,5 +70,4 @@ status(int type)
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(vib_sensor, VIB_SENSOR,
init, irq, activate, deactivate, active,
value, configure, status);

View File

@ -10,33 +10,6 @@ button_press(void)
sensors_changed(&button_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init(void)
{
}
/*---------------------------------------------------------------------------*/
static int
irq(void)
{
return 0;
}
/*---------------------------------------------------------------------------*/
static void
activate(void)
{
}
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
}
/*---------------------------------------------------------------------------*/
static int
active(void)
{
return 1;
}
/*---------------------------------------------------------------------------*/
static unsigned int
value(int type)
{
@ -56,5 +29,4 @@ status(int type)
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
init, irq, activate, deactivate, active,
value, configure, status);

View File

@ -13,33 +13,6 @@ pir_sensor_changed(int strength)
sensors_changed(&pir_sensor);
}
/*---------------------------------------------------------------------------*/
static void
init(void)
{
}
/*---------------------------------------------------------------------------*/
static int
irq(void)
{
return 0;
}
/*---------------------------------------------------------------------------*/
static void
activate(void)
{
}
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
}
/*---------------------------------------------------------------------------*/
static int
active(void)
{
return 1;
}
/*---------------------------------------------------------------------------*/
static unsigned int
value(int type)
{
@ -59,5 +32,4 @@ status(int type)
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
init, irq, activate, deactivate, active,
value, configure, status);

View File

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: radio-sensor.c,v 1.1 2006/10/06 08:25:31 adamdunkels Exp $
* @(#)$Id: radio-sensor.c,v 1.2 2010/01/14 15:38:56 adamdunkels Exp $
*/
#include "lib/sensors.h"
@ -45,29 +45,6 @@ init(void)
radio_sensor_signal = 0;
}
/*---------------------------------------------------------------------------*/
static int
irq(void)
{
return 0;
}
/*---------------------------------------------------------------------------*/
static void
activate(void)
{
}
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
radio_sensor_signal = 0;
}
/*---------------------------------------------------------------------------*/
static int
active(void)
{
return 1;
}
/*---------------------------------------------------------------------------*/
static unsigned int
value(int type)
{
@ -87,5 +64,4 @@ status(int type)
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(radio_sensor, RADIO_SENSOR,
init, irq, activate, deactivate, active,
value, configure, status);

View File

@ -29,14 +29,14 @@
* This file is part of the Configurable Sensor Network Application
* Architecture for sensor nodes running the Contiki operating system.
*
* $Id: vib-sensor.c,v 1.1 2006/06/17 22:41:36 adamdunkels Exp $
* $Id: vib-sensor.c,v 1.2 2010/01/14 15:38:56 adamdunkels Exp $
*
* -----------------------------------------------------------------
*
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
* Created : 2005-11-01
* Updated : $Date: 2006/06/17 22:41:36 $
* $Revision: 1.1 $
* Updated : $Date: 2010/01/14 15:38:56 $
* $Revision: 1.2 $
*/
#include "dev/vib-sensor.h"
@ -51,36 +51,6 @@ vib_sensor_changed(void)
sensors_changed(&vib_sensor);
}
/*---------------------------------------------------------------------------*/
static int
irq(void)
{
return 0;
}
/*---------------------------------------------------------------------------*/
static void
init(void)
{
vib = 0;
}
/*---------------------------------------------------------------------------*/
static void
activate(void)
{
vib = 1;
}
/*---------------------------------------------------------------------------*/
static void
deactivate(void)
{
vib = 0;
}
/*---------------------------------------------------------------------------*/
static int
active(void)
{
return vib;
}
/*---------------------------------------------------------------------------*/
static unsigned int
value(int type)
{
@ -100,5 +70,4 @@ status(int type)
}
/*---------------------------------------------------------------------------*/
SENSORS_SENSOR(vib_sensor, VIB_SENSOR,
init, irq, activate, deactivate, active,
value, configure, status);