Updated to match the new sensors API
This commit is contained in:
parent
4ffa7b95b7
commit
dbe56e4666
7 changed files with 24 additions and 28 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <io.h>
|
||||
#include "dev/irq.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
const struct sensors_sensor acc_sensor;
|
||||
static uint8_t active;
|
||||
|
|
|
@ -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 <io.h>
|
||||
#include "dev/irq.h"
|
||||
|
||||
const struct sensors_sensor battery_sensor;
|
||||
static uint8_t active;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue