fixed for updated sensors API
This commit is contained in:
parent
fe126bc90e
commit
3c0dcb45c7
|
@ -1,7 +1,7 @@
|
|||
# $Id: Makefile.sky,v 1.30 2010/01/14 14:00:38 joxe Exp $
|
||||
# $Id: Makefile.sky,v 1.31 2010/01/14 15:50:13 joxe Exp $
|
||||
|
||||
|
||||
ARCH=msp430.c leds.c watchdog.c light.c spi.c ds2411.c \
|
||||
ARCH=msp430.c leds.c watchdog.c spi.c ds2411.c \
|
||||
xmem.c i2c.c sht11.c light-sensor.c acc-sensor.c battery-sensor.c \
|
||||
cc2420.c cc2420-aes.c cc2420-arch.c cc2420-arch-sfd.c \
|
||||
node-id.c sensors.c button-sensor.c cfs-coffee.c \
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- C -*- */
|
||||
/* @(#)$Id: contiki-conf.h,v 1.62 2009/10/27 15:33:24 fros4943 Exp $ */
|
||||
/* @(#)$Id: contiki-conf.h,v 1.63 2010/01/14 15:50:13 joxe Exp $ */
|
||||
|
||||
#ifndef CONTIKI_CONF_H
|
||||
#define CONTIKI_CONF_H
|
||||
|
@ -96,7 +96,7 @@
|
|||
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
|
||||
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
|
||||
#define UIP_CONF_IP_FORWARD 0
|
||||
#define UIP_CONF_BUFFER_SIZE 256
|
||||
#define UIP_CONF_BUFFER_SIZE 108
|
||||
|
||||
#define SICSLOWPAN_CONF_COMPRESSION_IPV6 0
|
||||
#define SICSLOWPAN_CONF_COMPRESSION_HC1 1
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)$Id: contiki-sky-main.c,v 1.60 2010/01/14 14:00:38 joxe Exp $
|
||||
* @(#)$Id: contiki-sky-main.c,v 1.61 2010/01/14 15:50:13 joxe Exp $
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
|
@ -252,8 +252,8 @@ main(int argc, char **argv)
|
|||
* Initialize light and humidity/temp sensors.
|
||||
*/
|
||||
/*
|
||||
light_sensor.configure(SENSORS_ACTIVE, (void *) 1);
|
||||
battery_sensor.configure(SENSORS_ACTIVE, (void *) 1);
|
||||
light_sensor.configure(SENSORS_ACTIVE, 1);
|
||||
battery_sensor.configure(SENSORS_ACTIVE, 1);
|
||||
*/
|
||||
sht11_init();
|
||||
|
||||
|
@ -355,7 +355,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
#endif /* WITH_UIP */
|
||||
|
||||
button_sensor.configure(SENSORS_ACTIVE, (void *) 1);
|
||||
SENSORS_ACTIVATE(&button_sensor);
|
||||
|
||||
energest_init();
|
||||
ENERGEST_ON(ENERGEST_TYPE_CPU);
|
||||
|
|
|
@ -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…
Reference in a new issue