fixed ext-sensor for jcreate
This commit is contained in:
parent
a66821f1d1
commit
3a2eec2b1a
|
@ -1,11 +1,11 @@
|
||||||
# $Id: Makefile.sky,v 1.35 2010/02/02 20:59:45 joxe Exp $
|
# $Id: Makefile.sky,v 1.36 2010/02/13 11:20:48 joxe Exp $
|
||||||
|
|
||||||
|
|
||||||
ARCH=msp430.c leds.c watchdog.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 \
|
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 sht11-sensor.c \
|
cc2420.c cc2420-aes.c cc2420-arch.c cc2420-arch-sfd.c sht11-sensor.c \
|
||||||
node-id.c sensors.c button-sensor.c cfs-coffee.c sky-sensors.c\
|
node-id.c sensors.c button-sensor.c cfs-coffee.c sky-sensors.c\
|
||||||
radio-sensor.c uart1.c uip-ipchksum.c \
|
radio-sensor.c uart1.c uip-ipchksum.c ext-sensor.c\
|
||||||
checkpoint-arch.c #slip.c slip_uart1.c
|
checkpoint-arch.c #slip.c slip_uart1.c
|
||||||
|
|
||||||
#ext-sensor.c irq.c \
|
#ext-sensor.c irq.c \
|
||||||
|
|
|
@ -26,15 +26,15 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: ext-sensor.c,v 1.2 2010/02/06 14:41:24 adamdunkels Exp $
|
* $Id: ext-sensor.c,v 1.3 2010/02/13 11:20:48 joxe Exp $
|
||||||
*
|
*
|
||||||
* -----------------------------------------------------------------
|
* -----------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne, Marcus Lundén,
|
* Author : Adam Dunkels, Joakim Eriksson, Niclas Finne, Marcus Lundén,
|
||||||
* Jesper Karlsson
|
* Jesper Karlsson
|
||||||
* Created : 2005-11-01
|
* Created : 2005-11-01
|
||||||
* Updated : $Date: 2010/02/06 14:41:24 $
|
* Updated : $Date: 2010/02/13 11:20:48 $
|
||||||
* $Revision: 1.2 $
|
* $Revision: 1.3 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
@ -86,13 +86,13 @@ configure(int type, int c)
|
||||||
if(!status(SENSORS_ACTIVE)) {
|
if(!status(SENSORS_ACTIVE)) {
|
||||||
/* SREF_1 is Vref+ */
|
/* SREF_1 is Vref+ */
|
||||||
/* MemReg6 == P6.0/A0 == port "under" logo */
|
/* MemReg6 == P6.0/A0 == port "under" logo */
|
||||||
ADC12MCTL6 = (INCH_0 + SREF_1);
|
ADC12MCTL6 = (INCH_0 + SREF_0);
|
||||||
/* MemReg7 == P6.1/A1 == port "over" logo */
|
/* MemReg7 == P6.1/A1 == port "over" logo */
|
||||||
ADC12MCTL7 = (INCH_1 + SREF_1);
|
ADC12MCTL7 = (INCH_1 + SREF_0);
|
||||||
/* MemReg8 == P6.2/A2, bottom expansion port */
|
/* MemReg8 == P6.2/A2, bottom expansion port */
|
||||||
ADC12MCTL8 = (INCH_2 + SREF_1);
|
ADC12MCTL8 = (INCH_2 + SREF_0);
|
||||||
/* MemReg9 == P6.1/A3, bottom expansion port, End Of (ADC-)Sequence */
|
/* MemReg9 == P6.1/A3, bottom expansion port, End Of (ADC-)Sequence */
|
||||||
ADC12MCTL9 = (INCH_3 + SREF_1);
|
ADC12MCTL9 = (INCH_3 + SREF_0);
|
||||||
|
|
||||||
sky_sensors_activate(0x0F);
|
sky_sensors_activate(0x0F);
|
||||||
active = 1;
|
active = 1;
|
||||||
|
@ -107,4 +107,3 @@ configure(int type, int c)
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
SENSORS_SENSOR(ext_sensor, "Ext",
|
SENSORS_SENSOR(ext_sensor, "Ext",
|
||||||
value, configure, status);
|
value, configure, status);
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,14 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: ext-sensor.h,v 1.1 2009/08/25 16:24:49 adamdunkels Exp $
|
* $Id: ext-sensor.h,v 1.2 2010/02/13 11:20:48 joxe Exp $
|
||||||
*
|
*
|
||||||
* -----------------------------------------------------------------
|
* -----------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* Author : Marcus Lundén
|
* Author : Marcus Lundén
|
||||||
* Created : 2005-11-01
|
* Created : 2005-11-01
|
||||||
* Updated : $Date: 2009/08/25 16:24:49 $
|
* Updated : $Date: 2010/02/13 11:20:48 $
|
||||||
* $Revision: 1.1 $
|
* $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __EXT_SENSOR_H__
|
#ifndef __EXT_SENSOR_H__
|
||||||
|
@ -41,6 +41,11 @@
|
||||||
|
|
||||||
#include "lib/sensors.h"
|
#include "lib/sensors.h"
|
||||||
|
|
||||||
|
#define ADC0 0
|
||||||
|
#define ADC1 1
|
||||||
|
#define ADC2 2
|
||||||
|
#define ADC3 3
|
||||||
|
|
||||||
extern const struct sensors_sensor ext_sensor;
|
extern const struct sensors_sensor ext_sensor;
|
||||||
|
|
||||||
#define EXT_SENSOR "Ext"
|
#define EXT_SENSOR "Ext"
|
||||||
|
|
Loading…
Reference in a new issue