mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-04 18:31:32 +00:00
Updated to new sensors API
This commit is contained in:
parent
757ca59511
commit
08f06d8039
@ -10,22 +10,22 @@ button_press(void)
|
|||||||
sensors_changed(&button_sensor);
|
sensors_changed(&button_sensor);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static unsigned int
|
static int
|
||||||
value(int type)
|
value(int type)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static int
|
static int
|
||||||
configure(int type, void *c)
|
configure(int type, int value)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void *
|
static int
|
||||||
status(int type)
|
status(int type)
|
||||||
{
|
{
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
|
SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
|
||||||
|
@ -13,22 +13,22 @@ pir_sensor_changed(int strength)
|
|||||||
sensors_changed(&pir_sensor);
|
sensors_changed(&pir_sensor);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static unsigned int
|
static int
|
||||||
value(int type)
|
value(int type)
|
||||||
{
|
{
|
||||||
return pir_value;
|
return pir_value;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static int
|
static int
|
||||||
configure(int type, void *c)
|
configure(int type, int c)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void *
|
static int
|
||||||
status(int type)
|
status(int type)
|
||||||
{
|
{
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
|
SENSORS_SENSOR(pir_sensor, PIR_SENSOR,
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: radio-sensor.c,v 1.2 2010/01/14 15:38:56 adamdunkels Exp $
|
* @(#)$Id: radio-sensor.c,v 1.3 2010/02/23 18:43:43 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lib/sensors.h"
|
#include "lib/sensors.h"
|
||||||
@ -36,31 +36,25 @@
|
|||||||
|
|
||||||
const struct sensors_sensor radio_sensor;
|
const struct sensors_sensor radio_sensor;
|
||||||
|
|
||||||
unsigned int radio_sensor_signal;
|
unsigned int radio_sensor_signal = 0;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void
|
static int
|
||||||
init(void)
|
|
||||||
{
|
|
||||||
radio_sensor_signal = 0;
|
|
||||||
}
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
static unsigned int
|
|
||||||
value(int type)
|
value(int type)
|
||||||
{
|
{
|
||||||
return radio_sensor_signal;
|
return radio_sensor_signal;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static int
|
static int
|
||||||
configure(int type, void *c)
|
configure(int type, int c)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void *
|
static int
|
||||||
status(int type)
|
status(int type)
|
||||||
{
|
{
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
SENSORS_SENSOR(radio_sensor, RADIO_SENSOR,
|
SENSORS_SENSOR(radio_sensor, RADIO_SENSOR,
|
||||||
|
@ -29,20 +29,19 @@
|
|||||||
* This file is part of the Configurable Sensor Network Application
|
* This file is part of the Configurable Sensor Network Application
|
||||||
* Architecture for sensor nodes running the Contiki operating system.
|
* Architecture for sensor nodes running the Contiki operating system.
|
||||||
*
|
*
|
||||||
* $Id: vib-sensor.c,v 1.2 2010/01/14 15:38:56 adamdunkels Exp $
|
* $Id: vib-sensor.c,v 1.3 2010/02/23 18:43:43 adamdunkels Exp $
|
||||||
*
|
*
|
||||||
* -----------------------------------------------------------------
|
* -----------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
|
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
|
||||||
* Created : 2005-11-01
|
* Created : 2005-11-01
|
||||||
* Updated : $Date: 2010/01/14 15:38:56 $
|
* Updated : $Date: 2010/02/23 18:43:43 $
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dev/vib-sensor.h"
|
#include "dev/vib-sensor.h"
|
||||||
|
|
||||||
const struct sensors_sensor vib_sensor;
|
const struct sensors_sensor vib_sensor;
|
||||||
static unsigned int vib;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
@ -51,22 +50,22 @@ vib_sensor_changed(void)
|
|||||||
sensors_changed(&vib_sensor);
|
sensors_changed(&vib_sensor);
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static unsigned int
|
static int
|
||||||
value(int type)
|
value(int type)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static int
|
static int
|
||||||
configure(int type, void *c)
|
configure(int type, int c)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static void *
|
static int
|
||||||
status(int type)
|
status(int type)
|
||||||
{
|
{
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
SENSORS_SENSOR(vib_sensor, VIB_SENSOR,
|
SENSORS_SENSOR(vib_sensor, VIB_SENSOR,
|
||||||
|
Loading…
Reference in New Issue
Block a user