fixed for updated sensors API
This commit is contained in:
parent
fe126bc90e
commit
3c0dcb45c7
8 changed files with 37 additions and 37 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, Swedish Institute of Computer Science.
|
||||
* Copyright (c) 2010, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -26,14 +26,14 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: acc-sensor.c,v 1.4 2010/01/14 13:53:06 joxe Exp $
|
||||
* $Id: acc-sensor.c,v 1.5 2010/01/14 15:50:13 joxe Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
|
||||
* Created : 2005-11-01
|
||||
* Updated : $Date: 2010/01/14 13:53:06 $
|
||||
* $Revision: 1.4 $
|
||||
* Updated : $Date: 2010/01/14 15:50:13 $
|
||||
* $Revision: 1.5 $
|
||||
*/
|
||||
|
||||
#include "dev/acc-sensor.h"
|
||||
|
@ -87,7 +87,7 @@ deactivate(void)
|
|||
active = 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned int
|
||||
static int
|
||||
value(int type)
|
||||
{
|
||||
switch(type) {
|
||||
|
@ -104,7 +104,7 @@ value(int type)
|
|||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
configure(int type, void *c)
|
||||
configure(int type, int c)
|
||||
{
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
|
@ -117,15 +117,15 @@ configure(int type, void *c)
|
|||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void *
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return (void *) active;
|
||||
return active;
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
SENSORS_SENSOR(acc_sensor, ACC_SENSOR,
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: battery-sensor.c,v 1.4 2010/01/14 14:00:38 joxe Exp $
|
||||
* $Id: battery-sensor.c,v 1.5 2010/01/14 15:50:14 joxe Exp $
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne
|
||||
* Created : 2005-11-01
|
||||
* Updated : $Date: 2010/01/14 14:00:38 $
|
||||
* $Revision: 1.4 $
|
||||
* Updated : $Date: 2010/01/14 15:50:14 $
|
||||
* $Revision: 1.5 $
|
||||
*/
|
||||
|
||||
#include "dev/battery-sensor.h"
|
||||
|
@ -82,7 +82,7 @@ value(int type)
|
|||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
configure(int type, void *c)
|
||||
configure(int type, int c)
|
||||
{
|
||||
switch(type) {
|
||||
case SENSORS_ACTIVE:
|
||||
|
@ -95,13 +95,13 @@ configure(int type, void *c)
|
|||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void *
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
case SENSORS_ACTIVE:
|
||||
case SENSORS_READY:
|
||||
return (void *) active;
|
||||
return active;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: button-sensor.c,v 1.2 2010/01/14 13:53:06 joxe Exp $
|
||||
* @(#)$Id: button-sensor.c,v 1.3 2010/01/14 15:50:14 joxe Exp $
|
||||
*/
|
||||
#include "lib/sensors.h"
|
||||
#include "dev/hwconf.h"
|
||||
|
@ -38,7 +38,7 @@
|
|||
const struct sensors_sensor button_sensor;
|
||||
|
||||
static struct timer debouncetimer;
|
||||
static void* status(int type);
|
||||
static int status(int type);
|
||||
|
||||
HWCONF_PIN(BUTTON, 2, 7);
|
||||
HWCONF_IRQ(BUTTON, 2, 7);
|
||||
|
@ -68,7 +68,7 @@ value(int type)
|
|||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
configure(int type, void *c)
|
||||
configure(int type, int c)
|
||||
{
|
||||
switch (type) {
|
||||
case SENSORS_ACTIVE:
|
||||
|
@ -89,7 +89,7 @@ configure(int type, void *c)
|
|||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void *
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
|
@ -97,7 +97,7 @@ status(int type)
|
|||
case SENSORS_READY:
|
||||
return BUTTON_IRQ_ENABLED();
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
SENSORS_SENSOR(button_sensor, BUTTON_SENSOR,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2005, Swedish Institute of Computer Science
|
||||
* Copyright (c) 2005-2010, Swedish Institute of Computer Science
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: light-sensor.c,v 1.1 2010/01/14 13:53:06 joxe Exp $
|
||||
* @(#)$Id: light-sensor.c,v 1.2 2010/01/14 15:50:14 joxe Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -66,7 +66,7 @@ static light_sensor_init(void)
|
|||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static unsigned int
|
||||
static int
|
||||
value(int type)
|
||||
{
|
||||
/* should be constants */
|
||||
|
@ -79,7 +79,7 @@ value(int type)
|
|||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void *
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
switch (type) {
|
||||
|
@ -87,12 +87,12 @@ status(int type)
|
|||
case SENSORS_READY:
|
||||
return (ADC12CTL0 & (ADC12ON + REFON)) == (ADC12ON + REFON);
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
configure(int type, void *c)
|
||||
configure(int type, int c)
|
||||
{
|
||||
switch (type) {
|
||||
case SENSORS_ACTIVE:
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* @(#)$Id: radio-sensor.c,v 1.4 2010/01/14 13:53:06 joxe Exp $
|
||||
* @(#)$Id: radio-sensor.c,v 1.5 2010/01/14 15:50:14 joxe Exp $
|
||||
*/
|
||||
|
||||
#include "lib/sensors.h"
|
||||
|
@ -52,12 +52,12 @@ value(int type)
|
|||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
configure(int type, void *c)
|
||||
configure(int type, int c)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void *
|
||||
static int
|
||||
status(int type)
|
||||
{
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue