From 3c0dcb45c7af941bbf3b2832616951de5a16970c Mon Sep 17 00:00:00 2001 From: joxe Date: Thu, 14 Jan 2010 15:50:13 +0000 Subject: [PATCH] fixed for updated sensors API --- platform/sky/Makefile.sky | 4 ++-- platform/sky/contiki-conf.h | 4 ++-- platform/sky/contiki-sky-main.c | 8 ++++---- platform/sky/dev/acc-sensor.c | 18 +++++++++--------- platform/sky/dev/battery-sensor.c | 12 ++++++------ platform/sky/dev/button-sensor.c | 10 +++++----- platform/sky/dev/light-sensor.c | 12 ++++++------ platform/sky/dev/radio-sensor.c | 6 +++--- 8 files changed, 37 insertions(+), 37 deletions(-) diff --git a/platform/sky/Makefile.sky b/platform/sky/Makefile.sky index 625f25225..db2e802c0 100644 --- a/platform/sky/Makefile.sky +++ b/platform/sky/Makefile.sky @@ -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 \ diff --git a/platform/sky/contiki-conf.h b/platform/sky/contiki-conf.h index d87afd856..53a8dd817 100644 --- a/platform/sky/contiki-conf.h +++ b/platform/sky/contiki-conf.h @@ -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 diff --git a/platform/sky/contiki-sky-main.c b/platform/sky/contiki-sky-main.c index d5bdab57b..aead73f82 100644 --- a/platform/sky/contiki-sky-main.c +++ b/platform/sky/contiki-sky-main.c @@ -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 @@ -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); diff --git a/platform/sky/dev/acc-sensor.c b/platform/sky/dev/acc-sensor.c index 242e3e5c5..332264ad3 100644 --- a/platform/sky/dev/acc-sensor.c +++ b/platform/sky/dev/acc-sensor.c @@ -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, diff --git a/platform/sky/dev/battery-sensor.c b/platform/sky/dev/battery-sensor.c index 57b153a09..0f86785e2 100644 --- a/platform/sky/dev/battery-sensor.c +++ b/platform/sky/dev/battery-sensor.c @@ -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; } diff --git a/platform/sky/dev/button-sensor.c b/platform/sky/dev/button-sensor.c index d3d1d959f..30054ed63 100644 --- a/platform/sky/dev/button-sensor.c +++ b/platform/sky/dev/button-sensor.c @@ -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, diff --git a/platform/sky/dev/light-sensor.c b/platform/sky/dev/light-sensor.c index 2f63bd0ad..8fabf6146 100644 --- a/platform/sky/dev/light-sensor.c +++ b/platform/sky/dev/light-sensor.c @@ -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 @@ -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: diff --git a/platform/sky/dev/radio-sensor.c b/platform/sky/dev/radio-sensor.c index d566d805f..5655a6276 100644 --- a/platform/sky/dev/radio-sensor.c +++ b/platform/sky/dev/radio-sensor.c @@ -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;