From dbe56e46663f40783c15cd98a173478da7efff9d Mon Sep 17 00:00:00 2001 From: nifi Date: Thu, 14 Jan 2010 20:01:18 +0000 Subject: [PATCH] Updated to match the new sensors API --- platform/esb/dev/ctsrts-sensor.c | 11 ++++++----- platform/sky/Makefile.sky | 8 ++++---- platform/sky/contiki-conf.h | 4 ++-- platform/sky/dev/acc-sensor.c | 9 +++------ platform/sky/dev/battery-sensor.c | 7 +++---- platform/sky/dev/button-sensor.c | 6 +++--- platform/sky/dev/radio-sensor.c | 7 +++---- 7 files changed, 24 insertions(+), 28 deletions(-) diff --git a/platform/esb/dev/ctsrts-sensor.c b/platform/esb/dev/ctsrts-sensor.c index fddf59924..262c5e691 100644 --- a/platform/esb/dev/ctsrts-sensor.c +++ b/platform/esb/dev/ctsrts-sensor.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: ctsrts-sensor.c,v 1.2 2010/01/14 17:39:35 nifi Exp $ + * @(#)$Id: ctsrts-sensor.c,v 1.3 2010/01/14 20:03:27 nifi Exp $ */ /** @@ -49,8 +49,9 @@ const struct sensors_sensor ctsrts_sensor; HWCONF_PIN(RS232RTS, 1, 7); -HWCONF_PIN(RS232CTS, 1, 6); -HWCONF_IRQ(RS232CTS, 1, 6); +#define RS232CTS_IRQ() 6 +HWCONF_PIN(RS232CTS, 1, RS232CTS_IRQ()); +HWCONF_IRQ(RS232CTS, 1, RS232CTS_IRQ()); /*---------------------------------------------------------------------------*/ static int @@ -104,12 +105,12 @@ configure(int type, int value) RS232CTS_IRQ_EDGE_SELECTU(); } - irq_port1_activate(RS232CTS_IRQ_PORT(), irq); + irq_port1_activate(RS232CTS_IRQ(), irq); RS232CTS_ENABLE_IRQ(); } } else { RS232CTS_DISABLE_IRQ(); - irq_port1_deactivate(RS232CTS_IRQ_PORT()); + irq_port1_deactivate(RS232CTS_IRQ()); } return 1; } diff --git a/platform/sky/Makefile.sky b/platform/sky/Makefile.sky index db2e802c0..4568055a9 100644 --- a/platform/sky/Makefile.sky +++ b/platform/sky/Makefile.sky @@ -1,4 +1,4 @@ -# $Id: Makefile.sky,v 1.31 2010/01/14 15:50:13 joxe Exp $ +# $Id: Makefile.sky,v 1.32 2010/01/14 20:01:18 nifi Exp $ ARCH=msp430.c leds.c watchdog.c spi.c ds2411.c \ @@ -29,7 +29,7 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o} NUMPAR=20 -IHEXFILE=tmpimage.ihex +#IHEXFILE=tmpimage.ihex # Check if we are running under Windows ifdef OS @@ -87,8 +87,8 @@ ifdef MOTE $(MAKE) sky-u.$(subst /,-,$(word $(MOTE), $(MOTES))) else # MOTE %.upload: %.ihex - cp $< $(IHEXFILE) - $(MAKE) sky-reset sky-upload +# cp $< $(IHEXFILE) + $(MAKE) sky-reset sky-upload IHEXFILE=$< endif # MOTE sky-upload: sky-reset diff --git a/platform/sky/contiki-conf.h b/platform/sky/contiki-conf.h index 53a8dd817..f99ab5827 100644 --- a/platform/sky/contiki-conf.h +++ b/platform/sky/contiki-conf.h @@ -1,5 +1,5 @@ /* -*- C -*- */ -/* @(#)$Id: contiki-conf.h,v 1.63 2010/01/14 15:50:13 joxe Exp $ */ +/* @(#)$Id: contiki-conf.h,v 1.64 2010/01/14 20:01:18 nifi Exp $ */ #ifndef CONTIKI_CONF_H #define CONTIKI_CONF_H @@ -42,7 +42,7 @@ #include "msp430def.h" #ifndef RF_CHANNEL -#define RF_CHANNEL 26 +#define RF_CHANNEL 16 #endif /* RF_CHANNEL */ #define ELFLOADER_CONF_TEXT_IN_ROM 0 diff --git a/platform/sky/dev/acc-sensor.c b/platform/sky/dev/acc-sensor.c index 332264ad3..467918003 100644 --- a/platform/sky/dev/acc-sensor.c +++ b/platform/sky/dev/acc-sensor.c @@ -26,21 +26,18 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: acc-sensor.c,v 1.5 2010/01/14 15:50:13 joxe Exp $ + * $Id: acc-sensor.c,v 1.6 2010/01/14 20:01:18 nifi Exp $ * * ----------------------------------------------------------------- * * Author : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : 2005-11-01 - * Updated : $Date: 2010/01/14 15:50:13 $ - * $Revision: 1.5 $ + * Updated : $Date: 2010/01/14 20:01:18 $ + * $Revision: 1.6 $ */ #include "dev/acc-sensor.h" #include -#include "dev/irq.h" - -#include const struct sensors_sensor acc_sensor; static uint8_t active; diff --git a/platform/sky/dev/battery-sensor.c b/platform/sky/dev/battery-sensor.c index 0f86785e2..3bf11f866 100644 --- a/platform/sky/dev/battery-sensor.c +++ b/platform/sky/dev/battery-sensor.c @@ -26,19 +26,18 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: battery-sensor.c,v 1.5 2010/01/14 15:50:14 joxe Exp $ + * $Id: battery-sensor.c,v 1.6 2010/01/14 20:01:18 nifi Exp $ * * ----------------------------------------------------------------- * * Author : Adam Dunkels, Joakim Eriksson, Niclas Finne * Created : 2005-11-01 - * Updated : $Date: 2010/01/14 15:50:14 $ - * $Revision: 1.5 $ + * Updated : $Date: 2010/01/14 20:01:18 $ + * $Revision: 1.6 $ */ #include "dev/battery-sensor.h" #include -#include "dev/irq.h" const struct sensors_sensor battery_sensor; static uint8_t active; diff --git a/platform/sky/dev/button-sensor.c b/platform/sky/dev/button-sensor.c index 30054ed63..a633f9063 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.3 2010/01/14 15:50:14 joxe Exp $ + * @(#)$Id: button-sensor.c,v 1.4 2010/01/14 20:01:19 nifi Exp $ */ #include "lib/sensors.h" #include "dev/hwconf.h" @@ -60,8 +60,7 @@ interrupt(PORT2_VECTOR) ENERGEST_OFF(ENERGEST_TYPE_IRQ); } /*---------------------------------------------------------------------------*/ - -static unsigned int +static int value(int type) { return BUTTON_READ() || !timer_expired(&debouncetimer); @@ -85,6 +84,7 @@ configure(int type, int c) } else { BUTTON_DISABLE_IRQ(); } + return 1; } return 0; } diff --git a/platform/sky/dev/radio-sensor.c b/platform/sky/dev/radio-sensor.c index 5655a6276..c39f86eac 100644 --- a/platform/sky/dev/radio-sensor.c +++ b/platform/sky/dev/radio-sensor.c @@ -28,18 +28,17 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: radio-sensor.c,v 1.5 2010/01/14 15:50:14 joxe Exp $ + * @(#)$Id: radio-sensor.c,v 1.6 2010/01/14 20:01:19 nifi Exp $ */ #include "lib/sensors.h" -#include "dev/irq.h" #include "dev/cc2420.h" #include "dev/radio-sensor.h" const struct sensors_sensor radio_sensor; /*---------------------------------------------------------------------------*/ -static unsigned int +static int value(int type) { switch(type) { @@ -60,7 +59,7 @@ configure(int type, int c) static int status(int type) { - return NULL; + return 0; } /*---------------------------------------------------------------------------*/ SENSORS_SENSOR(radio_sensor, RADIO_SENSOR,