firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 29)
Brought to you by:
doolin
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(36) |
Jun
(45) |
Jul
(108) |
Aug
(31) |
Sep
(2) |
Oct
(4) |
Nov
(113) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(63) |
Feb
(37) |
Mar
(24) |
Apr
(6) |
May
(5) |
Jun
(5) |
Jul
(71) |
Aug
(42) |
Sep
(7) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(64) |
Jun
(71) |
Jul
(51) |
Aug
(89) |
Sep
(24) |
Oct
(1) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
|
Feb
|
Mar
(3) |
Apr
(2) |
May
|
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
Update of /cvsroot/firebug/mts400/sensors/i2c In directory sc8-pr-cvs1:/tmp/cvs-serv8640 Added Files: HPLI2CM.nc HPLInterrupt.nc I2CC.nc I2CPacketC.nc I2CPacketM.nc I2CSwitchCmds.nc Interrupt.nc Log Message: Adding the i2c driver code in stages due to sourceforge puking on 40k add limits. --- NEW FILE: HPLI2CM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ //Mohammad Rahimi,Phil Buonadonna module HPLI2CM { provides { interface StdControl; interface I2C; } uses interface Interrupt; uses interface Leds; } implementation { // global variables char state; // maintain the state of the current processx char global_data; #define SET_START_TX() sbi(TWCR,TWSTA) #define CLEAR_START_TX() cbi(TWCR,TWSTA) #define SET_STOP_TX() sbi(TWCR,TWSTO) #define CLEAR_STOP_TX() cbi(TWCR,TWSTO) #define I2C_ENABLE() sbi(TWCR,TWEN) #define I2C_DISABLE() cbi(TWCR,TWEN) #define INT_ENABLE() sbi(TWCR,TWIE) #define INT_DISABLE() cbi(TWCR,TWIE) #define INT_FLAG_ENABLE() sbi(TWCR,TWINT) #define INT_FLAG_DISABLE() cbi(TWCR,TWINT) #define ACK_ENABLE() sbi(TWCR,TWEA) #define NACK_ENABLE() cbi(TWCR,TWEA) #define RESET() outp(0x0,TWCR); #define MAKE_CLOCK_OUTPUT() sbi(DDRD, 0); #define CLOCK_HIGH() sbi(PORTD,0); #define CLCOK_LOW() sbi(PORTD,0); #define MAKE_DATA_INPUT() cbi(DDRD, 1); #define DATA_PULL_UP() sbi(PORTD, 1); #define DATA_NO_PULL_UP() cbi(PORTD, 1); // define constants for state enum { IDLE = 1, // idle MA_START, // Initiation of the Master Bus MA_ADDRESS, // Master Transmitter,writing address MA_DATA, // Master Transmitter,writing data MR_DATA, // Master Receiver ST, // Slave Transmitter SR // Slave Receiver }; // define TWI device status codes. enum { TWS_BUSERROR = 0x00, TWS_START = 0x08, TWS_RSTART = 0x10, TWS_MT_SLA_ACK = 0x18, TWS_MT_SLA_NACK = 0x20, TWS_MT_DATA_ACK = 0x28, TWS_MT_DATA_NACK = 0x30, TWS_M_ARB_LOST = 0x38, TWS_MR_SLA_ACK = 0x40, TWS_MR_SLA_NACK = 0x48, TWS_MR_DATA_ACK = 0x50, TWS_MR_DATA_NACK = 0x58 }; static inline void setBitRate() // See Note, Page 205 of ATmega128 docs { cbi(TWSR, TWPS0); cbi(TWSR, TWPS1); outp(100,TWBR); } static inline void init() { //sbi(PORTD, 0); // i2c SCL,this activate pullup resistor //sbi(PORTD, 1); // i2c SDA,this activate pullup resistor MAKE_CLOCK_OUTPUT(); MAKE_DATA_INPUT(); CLOCK_HIGH(); DATA_PULL_UP(); RESET(); I2C_ENABLE(); INT_ENABLE(); //********************* ACK_ENABLE(); call Interrupt.enable(); //********************* atomic { state = IDLE; } } static inline void reset() { RESET(); //INT_DISABLE(); //I2C_DISABLE(); setBitRate(); init(); } // Silly task to signal when a stop condition is completed. task void I2C_task() { loop_until_bit_is_clear(TWCR,TWSTO); INT_FLAG_ENABLE(); //INT_DISABLE(); //*************** signal I2C.sendEndDone(); } command result_t StdControl.init() { setBitRate(); init(); return SUCCESS; } command result_t StdControl.start() { return SUCCESS; } command result_t StdControl.stop() { return SUCCESS; } command result_t I2C.sendStart() { atomic { state=MA_START; } signal I2C.sendStartDone(); return SUCCESS; } void sendstart() { SET_START_TX(); INT_FLAG_ENABLE(); } void sendAddress() { outb(TWDR,global_data); //if(state==MA_ADDRESS) CLEAR_START_TX(); CLEAR_START_TX(); INT_FLAG_ENABLE(); } command result_t I2C.sendEnd() { SET_STOP_TX(); //INT_FLAG_ENABLE(); post I2C_task(); return SUCCESS; } // For reads and writes, if the TWINT bit is clear, the TWI is // busy or the TWI improperly initialized command result_t I2C.read(bool ack) { //if (bit_is_clear(TWCR,TWINT)) return FAIL; //if(state==MR_DATA){ //INT_ENABLE(); //****************** if (ack) ACK_ENABLE(); else NACK_ENABLE(); INT_FLAG_ENABLE(); //} return SUCCESS; } command result_t I2C.write(char data) { atomic { global_data=data; } //INT_ENABLE(); //****************** atomic { if(state==MA_START) { state=MA_ADDRESS; sendstart(); } if(state==MA_DATA) { //if(bit_is_clear(TWCR,TWINT)) return FAIL; //call Leds.redToggle(); outb(TWDR,data); INT_FLAG_ENABLE(); } } return SUCCESS; } default event result_t I2C.sendStartDone() { return SUCCESS; } default event result_t I2C.sendEndDone() { return SUCCESS; } default event result_t I2C.readDone(char data) { return SUCCESS; } default event result_t I2C.writeDone(bool success) { return SUCCESS; } TOSH_SIGNAL(SIG_2WIRE_SERIAL) { uint8_t i2cState; i2cState=inp(TWSR) & 0xF8; INT_FLAG_DISABLE(); switch (i2cState) { case TWS_BUSERROR: reset(); //outb(TWCR,((1 << TWSTO) | (1 << TWINT))); // Reset TWI break; case TWS_START: //08 case TWS_RSTART: //10 sendAddress(); //signal I2C.sendStartDone(); break; case TWS_MT_SLA_ACK: //18 state=MA_DATA; signal I2C.writeDone(TRUE); break; case TWS_MT_DATA_ACK: //28 state=MA_DATA; signal I2C.writeDone(TRUE); break; case TWS_MT_SLA_NACK: //20 signal I2C.writeDone(FALSE); break; case TWS_MT_DATA_NACK: //30 signal I2C.writeDone(FALSE); break; case TWS_MR_SLA_ACK: state=MA_DATA; signal I2C.writeDone(TRUE); break; case TWS_MR_SLA_NACK: signal I2C.writeDone(FALSE); break; case TWS_MR_DATA_ACK: case TWS_MR_DATA_NACK: state=MA_DATA; signal I2C.readDone(inb(TWDR)); break; default: //something wrong reset(); break; } } } --- NEW FILE: HPLInterrupt.nc --- /* tab:4 * * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* tab:4 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to * this license. If you do not agree to this license, do not download, * install, copy or use the software. * * Intel Open Source License * * Copyright (c) 2002 Intel Corporation * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * */ /* * * Authors: Jason Hill, David Gay, Philip Levis * Date last modified: 6/25/02 * */ // The hardware presentation layer. See hpl.h for the C side. // Note: there's a separate C side (hpl.h) to get access to the avr macros // The model is that HPL is stateless. If the desired interface is as stateless // it can be implemented here (Clock, FlashBitSPI). Otherwise you should // create a separate component module HPLInterrupt { provides interface Interrupt; } implementation { async command result_t Interrupt.enable() { sei(); return SUCCESS; } async command bool Interrupt.disable() { bool result = (inp(SREG) & 0x80) != 0; cli(); return result; } void TOSH_interrupt_enable() __attribute__((C)) { call Interrupt.enable(); } bool TOSH_interrupt_disable() __attribute__((C)) { return call Interrupt.disable(); } } --- NEW FILE: I2CC.nc --- /* * * Authors: Phil Buonadonna, Joe Polastre, Rob Szewczyk * Date last modified: 12/19/02 * * Note: Modify this configuration file to choose between software or hardware * based I2C. */ /* Uncomment line below to enable Hardware based I2C on the mica128 */ #define HARDWARE_I2C configuration I2CC { provides { interface StdControl; interface I2C; } } implementation { #ifdef HARDWARE_I2C components HPLI2CM, HPLInterrupt; StdControl = HPLI2CM; I2C = HPLI2CM; HPLI2CM.Interrupt->HPLInterrupt; #else components I2CM; StdControl = I2CM; I2C = I2CM; #endif } --- NEW FILE: I2CPacketC.nc --- /* tab:4 * * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* tab:4 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to * this license. If you do not agree to this license, do not download, * install, copy or use the software. * * Intel Open Source License * * Copyright (c) 2002 Intel Corporation * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * */ /* * * Authors: Joe Polastre * Date last modified: 7/18/02 * */ /** * Provides the ability to write or read a series of bytes to/from the * I2C bus. For more information, look at the I2CPacket.ti interface **/ configuration I2CPacketC { provides { interface StdControl; interface I2CPacket[uint8_t id]; } } implementation { components I2CC,I2CPacketM,LedsC; StdControl = I2CPacketM; I2CPacket = I2CPacketM; I2CPacketM.I2C -> I2CC; I2CPacketM.I2CStdControl -> I2CC.StdControl; I2CPacketM.Leds -> LedsC; } --- NEW FILE: I2CPacketM.nc --- /* tab:4 * * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* * * Authors: Joe Polastre, Rob Szewczyk * Date last modified: 7/18/02 * */ /** * Provides functionality for writing and reading packets on the I2C bus */ module I2CPacketM { provides { interface StdControl; interface I2CPacket[uint8_t id]; } uses { interface I2C; interface StdControl as I2CStdControl; interface Leds; } } implementation { /* state of the i2c request */ enum {IDLE=99, I2C_START_COMMAND=1, I2C_STOP_COMMAND=2, I2C_STOP_COMMAND_SENT=3, I2C_WRITE_ADDRESS=10, I2C_WRITE_DATA=11, I2C_READ_ADDRESS=20, I2C_READ_DATA=21, I2C_READ_DONE=22}; enum {STOP_FLAG=0x01, /* send stop command at the end of packet? */ ACK_FLAG =0x02, /* send ack after recv a byte (except for last byte) */ ACK_END_FLAG=0x04, /* send ack after last byte recv'd */ ADDR_8BITS_FLAG=0x80, // the address is a full 8-bits with no terminating readflag }; /** * bytes to write to the i2c bus */ char* data; /** * length in bytes of the request */ char length; /** * current index of read/write byte */ char index; /** * current state of the i2c request */ char state; /** * destination address */ char addr; /** * store flags */ char flags; /** * cache incoming bytes : 10 is a random number */ char temp[10]; /** * initialize the I2C bus and set initial state */ command result_t StdControl.init() { call I2CStdControl.init(); state = IDLE; index = 0; return SUCCESS; } /** * start the component **/ command result_t StdControl.start() { return SUCCESS; } /** * stop the component **/ command result_t StdControl.stop() { return SUCCESS; } /** * writes a series of bytes out to the I2C bus * * @param in_length number of bytes to be written to the bus * @param in_data pointer to the data * @param in_flags bitmask of flags (see I2CPacket.ti interface) * * @return returns SUCCESS if the bus is free and the request is accepted. */ command result_t I2CPacket.writePacket[uint8_t id](char in_length,char* in_data, char in_flags) { if (state == IDLE) { /* reset variables */ addr = id; data = in_data; index = 0; length = in_length; flags = in_flags; } else { return FAIL; } state = I2C_WRITE_ADDRESS; if (call I2C.sendStart()) { return SUCCESS; } else { state = IDLE; return FAIL; } } /** * reads a series of bytes out to the I2C bus * * @param in_length number of bytes to be read from the bus * @param in_flags bitmask of flags (see I2CPacket.ti interface) * * @return returns SUCCESS if the bus is free and the request is accepted. */ command result_t I2CPacket.readPacket[uint8_t id](char in_length, char in_flags) { if (state == IDLE) { addr = id; index = 0; length = in_length; flags = in_flags; } else { return FAIL; } state = I2C_READ_ADDRESS; if (call I2C.sendStart()) { return SUCCESS; } else { state = IDLE; return FAIL; } } /** * notification that the start symbol was sent **/ event result_t I2C.sendStartDone() { if(state == I2C_WRITE_ADDRESS){ state = I2C_WRITE_DATA; call I2C.write( (flags & ADDR_8BITS_FLAG) ? addr : ((addr << 1) + 0) ); } else if (state == I2C_READ_ADDRESS){ state = I2C_READ_DATA; call I2C.write( (flags & ADDR_8BITS_FLAG) ? addr : ((addr << 1) + 1) ); index++; } return 1; } /** * notification that the stop symbol was sent **/ event result_t I2C.sendEndDone() { if (state == I2C_STOP_COMMAND_SENT) { /* success! */ state = IDLE; signal I2CPacket.writePacketDone[addr](SUCCESS); } else if (state == I2C_READ_DONE) { state = IDLE; signal I2CPacket.readPacketDone[addr](length, data); } return SUCCESS; } /** * notification of a byte sucessfully written to the bus **/ event result_t I2C.writeDone(bool result) { if(result == FAIL) { state = IDLE; signal I2CPacket.writePacketDone[addr](FAIL); return FAIL; } if ((state == I2C_WRITE_DATA) && (index < length)) { index++; if (index == length) { state = I2C_STOP_COMMAND; } return call I2C.write(data[index-1]); } else if (state == I2C_STOP_COMMAND) { state = I2C_STOP_COMMAND_SENT; if (flags & STOP_FLAG) { return call I2C.sendEnd(); } else { state = IDLE; return signal I2CPacket.writePacketDone[addr](SUCCESS); } } else if (state == I2C_READ_DATA) { if (index == length) { return call I2C.read((flags & ACK_END_FLAG) == ACK_END_FLAG); } else if (index < length) return call I2C.read((flags & ACK_FLAG) == ACK_FLAG); } return SUCCESS; } /** * read a byte off the bus and add it to the packet **/ event result_t I2C.readDone(char in_data) { temp[index-1] = in_data; index++; if (index == length) call I2C.read((flags & ACK_END_FLAG) == ACK_END_FLAG); else if (index < length) call I2C.read((flags & ACK_FLAG) == ACK_FLAG); else if (index > length) { state = I2C_READ_DONE; data = (char*)(&temp); if (flags & STOP_FLAG) call I2C.sendEnd(); else { state = IDLE; signal I2CPacket.readPacketDone[addr](length, data); } } return SUCCESS; } default event result_t I2CPacket.readPacketDone[uint8_t id](char in_length, char* in_data) { return SUCCESS; } default event result_t I2CPacket.writePacketDone[uint8_t id](bool result) { return SUCCESS; } } --- NEW FILE: I2CSwitchCmds.nc --- interface I2CSwitchCmds { command result_t PowerSwitch(uint8_t PowerState); /* 0 => power off; 1 => power on */ //notify that I2C power switch has been set. //PowerState = 0 => power is off; PowerState = 1 => power is on event result_t SwitchesSet(uint8_t PowerState); //notify that I2C switches are set } --- NEW FILE: Interrupt.nc --- /* tab:4 * * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * */ /* tab:4 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to * this license. If you do not agree to this license, do not download, * install, copy or use the software. * * Intel Open Source License * * Copyright (c) 2002 Intel Corporation * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * */ /* * Authors: Jason Hill, David Gay, Philip Levis * Date last modified: 6/25/02 * * */ /** * Hardware interface to enable and disable interrupts. */ interface Interrupt { /** Disables interrupts. * @return TRUE iff interrupts were previously enabled */ async command bool disable(); /** * Enables interrupts. * * @return SUCCESS always. */ async command result_t enable(); } |
Update of /cvsroot/firebug/mts400/sensors/sensirion In directory sc8-pr-cvs1:/tmp/cvs-serv8117 Modified Files: SensirionHumidity.nc TempHum.nc Removed Files: GpsDriverM.nc HPLI2CM.nc HPLInterrupt.nc Interrupt.nc MicaWbSwitch.nc MicaWbSwitchM.nc Switch.nc Log Message: Removed all the i2c code from the sensirion driver directory because it is common to many of the drivers. Index: SensirionHumidity.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/sensirion/SensirionHumidity.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SensirionHumidity.nc 12 Nov 2003 01:44:20 -0000 1.1 --- SensirionHumidity.nc 12 Nov 2003 23:49:45 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- + + /* * *************** *** 39,45 **** SensirionHumidityM.HumError -> TempHum.HumError; ! SensirionHumidityM.TempError -> TempHum.TempError; ! ! SensirionHumidityM.Leds -> NoLeds; } --- 41,47 ---- SensirionHumidityM.HumError -> TempHum.HumError; ! SensirionHumidityM.TempError -> TempHum.TempError; ! ! SensirionHumidityM.Leds -> NoLeds; } Index: TempHum.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/sensirion/TempHum.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TempHum.nc 12 Nov 2003 01:44:20 -0000 1.1 --- TempHum.nc 12 Nov 2003 23:49:45 -0000 1.2 *************** *** 84,88 **** TempHumM.TimerControl -> TimerC; ! TempHumM.Timer -> TimerC.Timer[unique("Timer")]; TempHumM.Leds -> LedsC; } --- 84,88 ---- TempHumM.TimerControl -> TimerC; ! TempHumM.Timer -> TimerC.Timer[unique("Timer")]; TempHumM.Leds -> LedsC; } --- GpsDriverM.nc DELETED --- --- HPLI2CM.nc DELETED --- --- HPLInterrupt.nc DELETED --- --- Interrupt.nc DELETED --- --- MicaWbSwitch.nc DELETED --- --- MicaWbSwitchM.nc DELETED --- --- Switch.nc DELETED --- |
From: <do...@us...> - 2003-11-12 23:30:50
|
Update of /cvsroot/firebug/mts400/sensors/i2c In directory sc8-pr-cvs1:/tmp/cvs-serv4545/i2c Log Message: Directory /cvsroot/firebug/mts400/sensors/i2c added to the repository |
From: <do...@us...> - 2003-11-12 22:10:00
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv20363 Modified Files: spie_2004.tex Added Files: spie.cls spiebib.bst Log Message: . --- NEW FILE: spie.cls --- %% spie.cls - Version 2.8 %% LaTeX2e class file to format manuscript for SPIE Proceedings % History % Prepared by Rick Zaccone <za...@bu...> on 6/3/91. % Modified by Adrian F Clark <al...@uk...sex> 11-Jan-1992. % Modified by Ken Hanson <km...@la...> April, 1995 % Modified by Ken Hanson <km...@la...> June 23, 1997 % Modified by Ken Hanson <km...@la...> Nov. 3, 1997 % Modified by Ken Hanson <km...@la...> Dec. 10, 1997 % Modified by Ken Hanson <km...@la...> Mar. 8, 1998 % Modified by Ken Hanson <km...@la...> July 18, 2001 % Modified by Guenter Milde <G....@ph...> % August 1, 2001 % Convert to LaTex2e class and added option a4paper % Modified by Ken Hanson <km...@la...> August 29, 2001 % Update SPIE format, including new text field: 6.75 in by 8.75 in % citesort.sty embedded to facilitate concatenation of citations. % However, citesort may lead to problems when used with babel, % in which case it should be removed from this file. % 2.70 Modified by Ken Hanson <km...@la...> August 29, 2002 % Remove tabular in maketitle to properly handle long author list. % Use of \and in \author{} will start new line after inserting a % blank line. % Remove a4 option, leaving standard a4paper option in place. % Remove \hoffset and \voffset commands. Defaults are again zero. % 2.71 Modified by Ken Hanson <km...@la...> Sept. 18, 2002 % Correct short figure caption format, replacing : with . Thanks Mats. % 2.8 Modified by Ken Hanson <km...@la...> July 16, 2003 % Margins changed to match SPIE's new specs. % %%%%%%%%%%%%%%%%%%%%%%%% % Usage: % \documentclass[]{spie} % \documentclass[a4paper]{spie} %% use this for A4 paper % % This style file does not automatically implement all the formatting % required for an SPIE manuscript. The user must make a few % manual adjustments For proper formatting, such as: % 1. Title and subsubsection should be in lower case % except for the first letter and proper nouns or acronyms % 2. Subsection headings should be capitalized as for book titles % 3. Format authors as follows % \author{author1\supit{a}, author2\supit{b}, and author3\supit{c} \skiplinehalf % \supit{a}affiliation1\\ % \supit{b}affiliation2\\ % \supit{c}affiliation3 % } % %%% Note: \skiplinehalf and \supit{} are defined in this class % ------------------------------------------------------------ %% based on standard LaTeX article class -- %% need to define font Size Option inside spie.cls \NeedsTeXFormat{LaTeX2e} \ProvidesClass{spie}[2003/07/16 v2.80 SPIE Proceedings class] \LoadClassWithOptions{article} % build on standard article class \DeclareOption{a4paper}{% \AtEndOfClass{% \oddsidemargin -0.61cm % for side margins of 2cm \evensidemargin -0.61cm % for side margins of 2cm \typeout{a4paper used} } } %\DeclareOption{a4}{% %% non-standard option % \AtEndOfClass{% % \oddsidemargin -0.61cm % for side margins of 2cm % \evensidemargin -0.61cm % for side margins of 2cm % \typeout{a4 used} % } % } \ProcessOptions\relax % set margins for a4paper if specified %% type out specified font size \if0\@ptsize\typeout{ten-point font}\fi \if1\@ptsize\typeout{eleven-point font}\fi \if2\@ptsize\typeout{twelve-point font}\fi %% page format (see "Sample manuscript showing specifications and style") %% following based on default top and left offset of 1 inch = 25.4mm \topmargin 0.0in % for top margin of 1.00in %% the next two side margins are for US letter paper %% and are overridden by the a4paper option \oddsidemargin -0.125in % for side margin of 0.875 in \evensidemargin -0.125in % for side margin of 0.875 in % \textheight 8.74in % approx 22.2 cm \textwidth 6.75in % approx 17.1 cm \headheight 0in \headsep 0in % avoid extra space for header \pagestyle{empty} % no page numbers is default \parskip 1ex plus 1ex minus 0.3ex % spacing between paragraphs \date{} % avoid date %% space for floats - figures and tables \floatsep 0.9ex plus 0.3ex minus 0.6ex \textfloatsep 4ex plus 3ex minus 1.5ex \renewcommand{\textfraction}{0.10} \renewcommand{\floatpagefraction}{0.60} \renewcommand{\topfraction}{0.90} \renewcommand{\bottomfraction}{0.90} \setcounter{totalnumber}{3} \setcounter{topnumber}{2} \setcounter{bottomnumber}{2} %%%% useful definitions %%%% \def\skiplinehalf{\medskip\\} \def\skipline{\\} \def\exspace{\vspace{1ex}} % superscript in italics, % to cross reference author and affiliations \def\supit#1{\raisebox{0.8ex}{\small\it #1}\hspace{0.05em}} %%%% define \ample font size %%%% %% 10% larger than \normalsize for 10 pt, %% but smaller than \large \if0\@ptsize \def\ample{\@setsize\large{12pt}\xipt\@xipt} \else \def\ample{\large} \fi %%%% define title aspects %%%% \def\titlefont{\normalfont\LARGE\bfseries} %% insurance \if0\@ptsize \font\titlefont = cmbx12 at 16truept % 10pt \else \def\titlefont{\LARGE\bf} % other \fi \def\title#1{\gdef\@title{\titlefont #1}} \def\authorinfo#1{\gdef\@authorinfo{#1}} \authorinfo{} %% default is empty \def\maketitle{\par \begingroup \def\thefootnote{\fnsymbol{footnote}}% \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}% \if@twocolumn \twocolumn[\@maketitle]% \else \newpage \global\@topnum\z@ \@maketitle \fi \@thanks \endgroup \let\maketitle\relax \let\@maketitle\relax \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax %%%% define footnote attributes %%%% \renewcommand{\footnotesize}{\small} % enlarge footnote font to small \renewcommand{\thefootnote}{\fnsymbol{footnote}} \ifx\@authorinfo\empty \else\footnotetext[0]{\@authorinfo}\fi %% use zero to avoid footnote mark \renewcommand{\thefootnote}{\fnsymbol{footnote}} %% use footnote symbols, not numbers } % redefine \and for author list because \tabular was removed \def\and{\bigskip\\} \def\@maketitle{\newpage \null % move title to top of page \if0\@ptsize\vspace{-10mm}\else\vspace{-12mm}\fi \begin{center}% {\setlength{\baselineskip}{4.3ex} \@title \par} \vskip 3.5mm {\large % author and organization font size \@author \par} % remove tabular used in article.cls \vskip 1.5ex {\large \@date}% \end{center}% \par } %%%% section aspects %%%% % all headings bold % center section headings, ample size \def\sectfont{\centering\ample\bf} % sub- and subsubsection headings flush left \def\subsectfont{\raggedright\ample\bf} \def\subsubsectfont{\raggedright\normalsize\bf} \def\append{0} \def\section{\@startsection{section}{1}{\z@} {-2.5ex plus -1ex minus -0.5ex}{0.2ex plus 0.5ex minus 0ex}{\sectfont}} \def\subsection{\@startsection{subsection}{2}{\z@} {-1.5ex plus -1ex minus -0.5ex}{0.1ex plus 0.1ex minus 0.1ex}{\subsectfont}} \def\subsubsection{\@startsection{subsubsection}{3}{\z@} {-1ex plus -1ex minus -0.5ex}{0.1ex plus 0.1ex}{\subsubsectfont}} %% from latex.sty %% \@sect{NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP} %% {STYLE}[ARG1]{ARG2} \def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth \let\@svsec\@empty\else \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname.\hskip 0.3em plus 0.3em}\fi \@tempskipa #5\relax \ifdim \@tempskipa>\z@ \begingroup #6\relax \ifnum #2=1 %%(kmh) in appendix, add word appendix in front of section number \ifnum \append=1 {\interlinepenalty \@M APPENDIX \@svsec\uppercase{#8}\par} \else {\interlinepenalty \@M \@svsec\uppercase{#8}\par} \fi \else\ifnum #2=2 \noindent{\interlinepenalty \@M \@svsec #8\par} \else \noindent{\interlinepenalty \@M \@svsec #8\par} \fi \fi \endgroup \csname #1mark\endcsname{#7}\addcontentsline {toc}{#1}{\ifnum #2>\c@secnumdepth \else \protect\numberline{\csname the#1\endcsname}\fi #7}\else \def\@svsechd{#6\hskip #3\relax %% \relax added 2 May 90 \@svsec #8\csname #1mark\endcsname {#7}\addcontentsline {toc}{#1}{\ifnum #2>\c@secnumdepth \else \protect\numberline{\csname the#1\endcsname}\fi #7}}\fi \@xsect{#5}} %%%%% Special sections %%%%% \def\abstract{\section*{ABSTRACT}} \def\endabstract{} % Keywords \def\keywords#1{ \par\vspace{0.5ex}{\noindent\normalsize\bf Keywords:} #1 \vspace{0.5ex} %% provide extra space before first section } \def\acknowledgments{\section*{ACKNOWLEDGMENTS}} \def\endacknowledgments{} % Old spelling - acceptable, but not preferred \def\acknowledgements{\section*{ACKNOWLEDGMENTS}} \def\endacknowledgements{} %%%% references %%%% % Give the references section a section number \def\thebibliography#1{\section*{REFERENCES\@mkboth {REFERENCES}{REFERENCES}}\list {\arabic{enumi}.} {\settowidth\labelwidth{[#1]}\leftmargin\labelwidth \advance\leftmargin\labelsep \usecounter{enumi}} \def\newblock{\hskip .11em plus .33em minus .07em} %% reduce vspace between items \parskip -0.7ex plus 0.5ex minus 0ex \if0\@ptsize\else\small\fi %% smaller fonts \sloppy\clubpenalty4000\widowpenalty4000 \sfcode`\.=1000\relax} \let\endthebibliography=\endlist %%%% Add theorem, lemma, and definition environments %%%% % kmh - noindent \def\@begintheorem#1#2{ \par\noindent\bgroup{\sc #1\ #2. }\it\ignorespaces} \def\@opargbegintheorem#1#2#3{ \par\bgroup{\sc #1\ #2\ (#3). }\it\ignorespaces} \def\@endtheorem{\egroup} \def\proof{\par{\it Proof}. \ignorespaces} \def\endproof{{\ \vbox{\hrule\hbox{% \vrule height1.3ex\hskip0.8ex\vrule}\hrule }}\par} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{definition}[theorem]{Definition} %%%% Figure and table captions %%% \long\def\@makecaption#1#2{% % from article.cls \vskip\abovecaptionskip \sbox\@tempboxa{{\footnotesize\bf #1.\ }{\footnotesize #2}}% \ifdim \wd\@tempboxa >\hsize % bold with period {\footnotesize\bf #1.\ }{\footnotesize #2 \par} \else \global \@minipagefalse \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip} %%%% appendix aspects %%%% % use \appendix to start an appendix % use \section{} for each appendix section \def\appendix{\def\append{1} \par \setcounter{section}{0} \setcounter{subsection}{0} \setcounter{subsubsection}{0} \def\thesection{\Alph{section}} \def\thesubsection{\Alph{section}.\arabic{subsection}} \def\thesubsubsection{ \Alph{section}.\arabic{subsection}.\arabic{subsubsection}} } %%%% Citations are superscripts (from aip.sty) %%%% \def\@cite#1#2{\unskip\nobreak\relax \def\@tempa{$\m@th^{\hbox{\the\scriptfont0 #1}}$}% \futurelet\@tempc\@citexx} \def\@citexx{\ifx.\@tempc\let\@tempd=\@citepunct\else \ifx,\@tempc\let\@tempd=\@citepunct\else \let\@tempd=\@tempa\fi\fi\@tempd} \def\@citepunct{\@tempc\edef\@sf{ \spacefactor=\the\spacefactor\relax}\@tempa \@sf\@gobble} % \citenum emits the plain citation number without ornament % \citea puts its argument into the ornamentation for citations % thus \cite{foo} is equivalent to \citea{\citenum{foo}} \def\citenum#1{{\def\@cite##1##2{##1}\cite{#1}}} \def\citea#1{\@cite{#1}{}} % Collapse citation numbers to ranges. Non-numeric and undefined labels % are handled. No sorting is done. E.g., 1,3,2,3,4,5,foo,1,2,3,?,4,5 % gives 1,3,2-5,foo,1-3,?,4,5 \newcount\@tempcntc \def\@citexzzz[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do {\@ifundefined {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bf ?}\@warning {Citation `\@citeb' on page \thepage \space undefined}}% {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}% \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}% \else \advance\@tempcntb\@ne \ifnum\@tempcntb=\@tempcntc \else\advance\@tempcntb\m@ne\@citeo \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}} \def\@citeozzz{\ifnum\@tempcnta>\@tempcntb\else\@citea\def\@citea{,}% \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else \def\@citea{--}\fi \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi} % begin citesort.sty % A replacement for \@citex which sorts citation numbers as well as % compressing and allowing breaks. Based on cite.sty by Donald % Arseneau. % % for use in LaTeX say, \documentstyle[...,citesort,...]{...} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Allow, but strongly discourage, line breaks within a long % series of citations. Compress lists of successive numbers % to one number range, e.g., 5,6,7,8,9 --> 5--9. Compatible % with versions of \@cite that use exponents. % -- Donald Arseneau 1989 % % Modified to sort the numbers so they come out in increasing order, % regardless of the way they appear in the source. O(N^2) sort! % Ian Green, CUED, 10-Dec-1991. Improvements to im...@en... % please. Version 1 \newcount\@minsofar \newcount\@min \newcount\@cite@temp \def\@citex[#1]#2{% \if@filesw \immediate \write \@auxout {\string \citation {#2}}\fi \@tempcntb\m@ne \let\@h@ld\relax \def\@citea{}% \@min\m@ne% \@cite{% \@for \@citeb:=#2\do {\@ifundefined {b@\@citeb}% {\@h@ld\@citea\@tempcntb\m@ne{\bf ?}% \@warning {Citation `\@citeb ' on page \thepage \space undefined}}% {\@minsofar\z@ \@for \@scan@cites:=#2\do {% \@ifundefined{b@\@scan@cites}% {\@cite@temp\m@ne} {\@cite@temp\number\csname b@\@scan@cites \endcsname \relax}% \ifnum\@cite@temp > \@min% select the next one to list \ifnum\@minsofar = \z@ \@minsofar\number\@cite@temp \edef\@scan@copy{\@scan@cites}\else \ifnum\@cite@temp < \@minsofar \@minsofar\number\@cite@temp \edef\@scan@copy{\@scan@cites}\fi\fi\fi}\@tempcnta\@min \ifnum\@minsofar > \z@ % some more \advance\@tempcnta\@ne \@min\@minsofar \ifnum\@tempcnta=\@minsofar % Number follows previous--hold on to it \ifx\@h@ld\relax \edef \@h@ld{\@citea\csname b@\@scan@copy\endcsname}% \else \edef\@h@ld{\ifmmode{-}\else--\fi\csname b@\@scan@copy\endcsname}% \fi \else \@h@ld\@citea\csname b@\@scan@copy\endcsname \let\@h@ld\relax \fi % no more \fi}% \def\@citea{,\penalty\@highpenalty\,}}\@h@ld}{#1}} % end of citesort.sty %% end of spie.cls --- NEW FILE: spiebib.bst --- % spiebib.bst - Version 2.6 % for Proc. SPIE, remove comma between journal name and vol. % BibTeX bibliography style file for MaxEnt95 % Essentially same as ieeetr.sty, % but with bold journal volume number, % no parentheses around editors, % and publisher/address fields reversed. % July 3, 1995 (kmh) Ken Hanson % In "inproceedings" allow 'journal' and avoid complaint % if 'booktitle' missing. % Dec. 10, 1997 (kmh) Ken Hanson % In "inproceedings", 'series' produces the same output as previous 'journal' % May 14, 2001 (hto) Hwa-Tung Ong % Put 'volume' in bold after 'series' in "collection", "incollection", % and "inproceedings". % Aug. 29, 2001 (kmh) Ken Hanson % % IEEE Transactions bibliography style (29-Jan-88 version) [...1011 lines suppressed...] 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} Index: spie_2004.tex =================================================================== RCS file: /cvsroot/firebug/firebug/web/spie_2004.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** spie_2004.tex 15 Oct 2003 23:14:25 -0000 1.13 --- spie_2004.tex 12 Nov 2003 22:09:56 -0000 1.14 *************** *** 1,3 **** ! \documentclass[11pt]{article} --- 1,3 ---- ! \documentclass[]{spie} *************** *** 14,30 **** \newcommand{\blast}{BLAST} ! \begin{document} \title{Sensor network behavior at the urban-rural interface: making smart structures smarter} - \author{M. M. Chen\thanks{Graduate student, - Dept. of Civil and Env. Eng., UC Berkeley}, - A. Sharma\thanks{EECS}, D. M. Doolin\thanks{% - Post-doctoral researcher, Dept. of Civ. and Env. Eng., - UC Berkeley}, S. Glaser, N. Sitar} - \date{\today} - \maketitle \begin{abstract} Abstract here will be a 1 paragraph summary of --- 14,43 ---- \newcommand{\blast}{BLAST} ! \title{Sensor network behavior at the urban-rural interface: making smart structures smarter} + \author{M. M. Chen\supit{a}, A. Sharma\supit{b}, D. M. Doolin\supit{b}, + S. Glaser\supit{b} and N. Sitar\supit{b} + \skiplinehalf + \supit{a}University of California, Civil and Environmental Engineering; \\ + \supit{b}Affiliation2, Address, City, Country + } + + %\author{M. M. Chen\thanks{Graduate student, + %Dept. of Civil and Env. Eng., UC Berkeley}, + %A. Sharma\thanks{EECS}, D. M. Doolin\thanks{% + %Post-doctoral researcher, Dept. of Civ. and Env. Eng., + %UC Berkeley}, S. Glaser, N. Sitar} + %\date{\today} + %\maketitle + \authorinfo{Further author information: (Send correspondence to A.A.A.)\\A.A.A.: E-mail: aa...@tb..., Telephone: 1 505 123 1234\\ B.B.A.: E-mail: bb...@cm..., Telephone: +33 (0)1 98 76 54 32} + + \begin{document} + + \maketitle + \begin{abstract} Abstract here will be a 1 paragraph summary of *************** *** 489,493 **** \bibliography{spie} ! \bibliographystyle{chicago} \appendix --- 502,506 ---- \bibliography{spie} ! \bibliographystyle{spiebib} \appendix |
From: <do...@us...> - 2003-11-12 02:49:13
|
Update of /cvsroot/firebug/mts400/sensors/gps In directory sc8-pr-cvs1:/tmp/cvs-serv2694/sensors/gps Modified Files: GpsC.nc Log Message: Minor cleanups. Index: GpsC.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/gps/GpsC.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GpsC.nc 11 Nov 2003 01:59:40 -0000 1.1 --- GpsC.nc 12 Nov 2003 02:49:10 -0000 1.2 *************** *** 1,3 **** ! /* tab:4 * * --- 1,6 ---- ! /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ ! ! ! /** * * *************** *** 61,81 **** /* * ! * Authors: ! * Date last modified: 6/25/02 ! * */ ! configuration GpsC ! { ! provides interface Gps ! } ! } ! implementation ! { ! components GpsPacketM ; ! ! Gps = GpsPacketM.Gps; ! ! } --- 64,83 ---- /* * ! * $Id$ */ ! configuration GpsC { ! ! provides { ! interface Gps ! } ! } ! ! implementation { ! ! components GpsPacketM ; ! ! Gps = GpsPacketM.Gps; ! } |
From: <do...@us...> - 2003-11-12 02:49:13
|
Update of /cvsroot/firebug/mts400/apps/TestGPS In directory sc8-pr-cvs1:/tmp/cvs-serv2694/apps/TestGPS Modified Files: gps_newM.nc Log Message: Minor cleanups. Index: gps_newM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestGPS/gps_newM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gps_newM.nc 12 Nov 2003 01:44:20 -0000 1.3 --- gps_newM.nc 12 Nov 2003 02:49:10 -0000 1.4 *************** *** 36,40 **** * this should not happen and is a problem. */ ! #define GPS_ONE_SHOT 0 --- 36,40 ---- * this should not happen and is a problem. */ ! #define GPS_ONE_SHOT 1 *************** *** 79,87 **** SODbg(DBG_USR2, "StdControl.stop() \n"); - #if GPS_ONE_SHOT if (call GpsCmd.PowerSwitch(GPS_POWER_OFF)) { SODbg(DBG_USR2, "GPS sensor powered off. \n"); } - #define /** Timer.stop always returns success. */ call Timer.stop(); --- 79,85 ---- *************** *** 202,206 **** } SODbg(DBG_USR2, "\n"); ! call StdControl.stop(); return data; } --- 200,214 ---- } SODbg(DBG_USR2, "\n"); ! ! #if GPS_ONE_SHOT ! { ! static uint16_t msg_count = 0; ! if (msg_count == 4) { ! call StdControl.stop(); ! } ! msg_count++; ! } ! #endif ! return data; } |
From: <do...@us...> - 2003-11-12 02:05:40
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv28863 Modified Files: gps.html Log Message: Added more info on gps gga format to web page. Index: gps.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/gps.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gps.html 16 Sep 2003 20:48:45 -0000 1.10 --- gps.html 12 Nov 2003 02:05:37 -0000 1.11 *************** *** 1,3 **** --- 1,4 ---- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> + <html xmlns="http://www.w3.org/1999/xhtml"> <head name="author" content="Carmel Majidi, UC Berkeley" /="" type="text/css" rel="stylesheet" href="firebug.css"> *************** *** 94,98 **** <h2><a href="gps_tests.htm">Receiver Characterization</a></h2> ! <hr /=""> <h2>Useful Links</h2> --- 95,143 ---- <h2><a href="gps_tests.htm">Receiver Characterization</a></h2> ! ! ! <h2>Global Positioning System Fix Data (GGA)</h2> ! ! ! <pre> ! $GPGGA,[1],[2],[3],[4],[5],[6],[7],[8],[9],M,[11],[12],[13][CR][LF] ! ! ! ! 1) UTC time of position fix, hhmmss.sss format ! ! 2) Latitude, ddmm.mmmm format. ! ! 3) Latitude hemisphere, N or S. ! ! 4) Longitude, dddmm.mmmm format. ! ! 5) Longitude hemisphere, E or W. ! ! 6) Position Fix Indicator, ! ! 0 = fix not available, or invalid. ! 1 = GPS SPS Mode, fix valid. ! 2 = Differential GPS, SPS Mode, fix valid. ! 3 = GPS PPS Mode, fix valid. ! ! 7) Number of sate1lites in use, 00 to 12. ! ! 8) Horizontal Dilution of Precision, 0.5 to 99.9. ! ! 9) MSL Altitude, -9999.9 to 99999.9 meters. ! ! 10) Geoidal height, -999.9 to 9999.9 meters. ! ! 11) Differential GPS (RTCM SC-104) data age, number of seconds since last valid RTCM transmission (nu1l if non-DGPS). ! ! 12) Differential Reference Station ID, 0000 to 1023. (null if non-DGPS) ! ! 13) Checksum. ! </pre> ! ! ! ! <hr /> <h2>Useful Links</h2> *************** *** 103,107 **** -- interactive USGS topo map of the entire U.S.A.</p> ! <hr /=""> <p> Last updated: $Date$ by $Author$. </p> --- 148,152 ---- -- interactive USGS topo map of the entire U.S.A.</p> ! <hr /> <p> Last updated: $Date$ by $Author$. </p> |
From: <do...@us...> - 2003-11-12 01:44:23
|
Update of /cvsroot/firebug/mts400/apps/TestGPS In directory sc8-pr-cvs1:/tmp/cvs-serv25577/apps/TestGPS Modified Files: gps_new.nc gps_newM.nc Log Message: GPS sensor now runs by itself independently of the humidity sensor. Not sure if it is running correctly yet. Will need to compare output with GGA spec. Index: gps_new.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestGPS/gps_new.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gps_new.nc 11 Nov 2003 01:58:36 -0000 1.1 --- gps_new.nc 12 Nov 2003 01:44:20 -0000 1.2 *************** *** 6,44 **** configuration gps_new { - #if 0 - provides { - interface SplitControl; - } - #endif - } implementation { ! components Main, ! gps_newM, ! MicaWbSwitch, ! UARTGpsPacket, ! TimerC, ! // NoLeds, ! LedsC; ! Main.StdControl -> gps_newM.StdControl; ! Main.StdControl -> TimerC.StdControl; ! Main.StdControl -> MicaWbSwitch.StdControl; ! //Easy stuff ! gps_newM.Leds -> LedsC; ! gps_newM.Timer -> TimerC.Timer[unique("Timer")]; ! /** New stuff for using gps without sensirion. */ //gps_newM.SwitchControl -> MicaWbSwitch.StdControl; gps_newM.PowerSwitch -> MicaWbSwitch.Switch[0]; gps_newM.IOSwitch -> MicaWbSwitch.Switch[1]; ! ! gps_newM.GpsControl -> UARTGpsPacket; ! gps_newM.GpsSend -> UARTGpsPacket; ! gps_newM.GpsReceive -> UARTGpsPacket; ! gps_newM.GpsCmd -> UARTGpsPacket.GpsCmd; } --- 6,35 ---- configuration gps_new { } implementation { ! components Main, ! gps_newM, ! MicaWbSwitch, ! UARTGpsPacket, ! TimerC, ! LedsC; ! Main.StdControl -> gps_newM.StdControl; ! Main.StdControl -> TimerC.StdControl; ! Main.StdControl -> MicaWbSwitch.StdControl; ! gps_newM.Leds -> LedsC; ! gps_newM.Timer -> TimerC.Timer[unique("Timer")]; ! /** Use gps without sensirion. */ //gps_newM.SwitchControl -> MicaWbSwitch.StdControl; gps_newM.PowerSwitch -> MicaWbSwitch.Switch[0]; gps_newM.IOSwitch -> MicaWbSwitch.Switch[1]; ! gps_newM.GpsControl -> UARTGpsPacket; ! gps_newM.GpsSend -> UARTGpsPacket; ! gps_newM.GpsReceive -> UARTGpsPacket; ! gps_newM.GpsCmd -> UARTGpsPacket.GpsCmd; } Index: gps_newM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestGPS/gps_newM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gps_newM.nc 12 Nov 2003 00:11:47 -0000 1.2 --- gps_newM.nc 12 Nov 2003 01:44:20 -0000 1.3 *************** *** 14,24 **** interface Leds; ! // new stuff for using gps without sensirion ! interface StdControl as SwitchControl; ! interface Switch as PowerSwitch; ! interface Switch as IOSwitch; ! interface StdControl as GpsControl; ! //interface SplitControl as GpsControl; interface I2CSwitchCmds as GpsCmd; --- 14,22 ---- interface Leds; ! interface StdControl as SwitchControl; ! interface Switch as PowerSwitch; ! interface Switch as IOSwitch; ! interface StdControl as GpsControl; interface I2CSwitchCmds as GpsCmd; *************** *** 33,47 **** #include "gps.h" ! char state; ! ! enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, ! OPENSCK, OPENDATA, CLOSESCK, CLOSEDATA, POWEROFF, ! MAIN_SWITCH_ON, MAIN_SWITCH_OFF, WAIT_SWITCH_ON, WAIT_SWITCH_OFF, TIMER}; - /**** StdControl **/ command result_t StdControl.init() { --- 31,50 ---- #include "gps.h" ! /** 0 means GPS runs forever, 1 means it takes one reading ! * and powers down. ! * FIXME: The GPS sensor powers back up after it powers down, ! * this should not happen and is a problem. ! */ ! #define GPS_ONE_SHOT 0 + char state; + enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, + OPENSCK, OPENDATA, CLOSESCK, CLOSEDATA, POWEROFF, + MAIN_SWITCH_ON, MAIN_SWITCH_OFF, WAIT_SWITCH_ON, + WAIT_SWITCH_OFF, TIMER}; command result_t StdControl.init() { *************** *** 49,55 **** init_debug(); call Leds.init(); ! /* Control.init in GpsPacket.nc */ call GpsControl.init(); - return SUCCESS; } --- 52,57 ---- init_debug(); call Leds.init(); ! /** Control.init in GpsPacket.nc */ call GpsControl.init(); return SUCCESS; } *************** *** 57,60 **** --- 59,64 ---- command result_t StdControl.start() { + call Leds.redOn(); + /* Control.start in GpsPacket.nc */ call GpsControl.start(); *************** *** 65,68 **** --- 69,73 ---- } + /** Do we need this? */ call Timer.start(TIMER_REPEAT, 1000) ; *************** *** 72,89 **** command result_t StdControl.stop() { ! return call Timer.stop(); ! //return SUCCESS; } ! /****************************************************/ ! /** Timer */ ! event result_t Timer.fired() { ! call Leds.greenToggle(); ! ! return SUCCESS; ! } --- 77,101 ---- command result_t StdControl.stop() { ! SODbg(DBG_USR2, "StdControl.stop() \n"); ! ! #if GPS_ONE_SHOT ! if (call GpsCmd.PowerSwitch(GPS_POWER_OFF)) { ! SODbg(DBG_USR2, "GPS sensor powered off. \n"); ! } ! #define ! /** Timer.stop always returns success. */ ! call Timer.stop(); ! return SUCCESS; } ! /****************************************************/ ! /** Timer */ ! event result_t Timer.fired() { ! //call Leds.greenToggle(); ! return SUCCESS; ! } *************** *** 93,183 **** /** PowerSwitch */ ! event result_t PowerSwitch.getDone(char value) { ! return SUCCESS; ! } ! event result_t PowerSwitch.setDone(bool local_result) { ! switch(state) { ! case MAIN_SWITCH_ON: ! state = IDLE; ! //signal GpsControl.startDone(); ! break; ! case MAIN_SWITCH_OFF: ! state = POWEROFF; ! //signal GpsControl.stopDone(); ! break; ! case WAIT_SWITCH_ON: ! ! if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { ! state = MAIN_SWITCH_ON; ! } ! break; ! case WAIT_SWITCH_OFF: ! if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { ! state = MAIN_SWITCH_OFF; } - default: - break; - - } - return SUCCESS; - - - - } - - - event result_t PowerSwitch.setAllDone(bool local_result) { - return SUCCESS; - } - ! /****************************************************/ ! /** IOSwitch */ - //#if 0 - event result_t IOSwitch.getDone(char value) { - return SUCCESS; - } ! event result_t IOSwitch.setAllDone(bool local_result) { ! return SUCCESS; ! } ! event result_t IOSwitch.setDone(bool local_result) { ! SODbg(DBG_USR2, "SensirionHumidityM.SwitchI2W: state: %i \n", state); ! if (state == OPENSCK) { //SCK line enabled ! state = OPENDATA; ! return call IOSwitch.set(MICAWB_HUMIDITY_DATA,1); ! } else if (state == OPENDATA) { //Data line enabled ! state = TIMER; ! SODbg(DBG_USR2, "SensirionHumidityM.SwitchI2W: Timer Started \n"); ! return call Timer.start(TIMER_ONE_SHOT, 100); ! } else if (state == CLOSESCK) { ! state = CLOSEDATA; ! return call IOSwitch.set(MICAWB_HUMIDITY_DATA,0); ! } else if (state == CLOSEDATA) { ! } ! return SUCCESS; ! } ! //#endif ! ! /** * Packet received from GPS - ASCII msg * 1st byte in pkt is number of ascii bytes ! * async used only for testing */ event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { --- 105,194 ---- /** PowerSwitch */ ! event result_t PowerSwitch.getDone(char value) { ! return SUCCESS; ! } ! /** FIXME: Make sure we don't need the startDone, stopDone ! * calls. ! */ ! event result_t PowerSwitch.setDone(bool local_result) { ! switch(state) { ! ! case MAIN_SWITCH_ON: ! state = IDLE; ! /** GpsControl is wired to GpsPacket.nc */ ! //signal GpsControl.startDone(); ! break; ! case MAIN_SWITCH_OFF: ! state = POWEROFF; ! /** GpsControl is wired to GpsPacket.nc */ ! //signal GpsControl.stopDone(); ! break; ! case WAIT_SWITCH_ON: ! if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { ! state = MAIN_SWITCH_ON; ! } ! break; ! case WAIT_SWITCH_OFF: ! if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { ! state = MAIN_SWITCH_OFF; ! } ! default: ! break; } + return SUCCESS; + } ! event result_t PowerSwitch.setAllDone(bool local_result) { ! return SUCCESS; ! } ! event result_t IOSwitch.getDone(char value) { ! return SUCCESS; ! } ! event result_t IOSwitch.setAllDone(bool local_result) { ! return SUCCESS; ! } ! /** FIXME: Rewrite this with a switch/case. */ ! event result_t IOSwitch.setDone(bool local_result) { ! SODbg(DBG_USR2, "IOSwitch.setDone(): state: %i \n", state); ! if (state == OPENSCK) { //SCK line enabled ! state = OPENDATA; ! return call IOSwitch.set(MICAWB_HUMIDITY_DATA,1); ! } else if (state == OPENDATA) { //Data line enabled ! state = TIMER; ! SODbg(DBG_USR2, "IOSwitch.setDone(): Timer Started, state: %i \n", ! state); ! return call Timer.start(TIMER_ONE_SHOT, 100); ! } else if (state == CLOSESCK) { ! state = CLOSEDATA; ! return call IOSwitch.set(MICAWB_HUMIDITY_DATA,0); ! } else if (state == CLOSEDATA) { ! } ! return SUCCESS; ! } /** * Packet received from GPS - ASCII msg * 1st byte in pkt is number of ascii bytes ! * async used only for testing. ! * ! * FIXME: Why is the data return? It should be ! * declared const. ! * ! * This function is called from GpsPacket.receiveTask(). */ event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { *************** *** 190,194 **** UARTPutChar(gps_data->data[i]); } ! SODbg(DBG_USR2, "\n"); return data; } --- 201,206 ---- UARTPutChar(gps_data->data[i]); } ! SODbg(DBG_USR2, "\n"); ! call StdControl.stop(); return data; } *************** *** 196,199 **** --- 208,213 ---- event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { + SODbg(DBG_USR2, "GpsSend.sendDone()\n", state); + return SUCCESS; } *************** *** 206,211 **** return SUCCESS; } - - } --- 220,223 ---- |
Update of /cvsroot/firebug/mts400/sensors/gps In directory sc8-pr-cvs1:/tmp/cvs-serv25577/sensors/gps Modified Files: GpsPacket.nc gps.h Removed Files: SensirionHumidity.nc SensirionHumidityM.nc TempHum.nc TempHumM.nc Log Message: GPS sensor now runs by itself independently of the humidity sensor. Not sure if it is running correctly yet. Will need to compare output with GGA spec. Index: GpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/gps/GpsPacket.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GpsPacket.nc 12 Nov 2003 00:11:47 -0000 1.2 --- GpsPacket.nc 12 Nov 2003 01:44:20 -0000 1.3 *************** *** 127,131 **** norace uint8_t state; ! norace uint16_t rxCount, rxLength, txCount, txLength; --- 127,139 ---- norace uint8_t state; ! norace uint16_t rxLength, txCount, txLength; ! ! /** This is only used in ByteComm.rxByteReady(), but ! * apparently needs to maintain its value between ! * successive calls. ! * FIXME: Why isn't rxCount declared static in its ! * function? Remove if possible. ! */ ! uint16_t rxCount; *************** *** 162,166 **** state_gps_pkt = NO_GPS_START_BYTE; state = IDLE; ! txCount = rxCount = 0; rxLength = GPS_DATA_LENGTH; return call ByteControl.init(); --- 170,175 ---- state_gps_pkt = NO_GPS_START_BYTE; state = IDLE; ! txCount = 0; ! rxCount = 0; rxLength = GPS_DATA_LENGTH; return call ByteControl.init(); *************** *** 199,318 **** } } ! return FAIL; } /* Command to transmit a packet */ ! command result_t Send.send(TOS_MsgPtr msg) { ! state = PACKET; ! msg->crc = 1; /* Fake out the CRC as passed. */ ! return call txBytes((uint8_t *)msg, TOS_MsgLength(msg->type)); ! } /* Command to transfer a variable length packet */ ! command result_t SendVarLenPacket.send(uint8_t* packet, uint8_t numBytes) { ! state = BYTES; ! return call txBytes(packet, numBytes); ! } ! task void sendDoneFailTask() { ! txCount = 0; ! state = IDLE; ! signal Send.sendDone((TOS_MsgPtr)sendPtr, FAIL); ! } - task void sendDoneSuccessTask() { ! txCount = 0; ! state = IDLE; ! signal Send.sendDone((TOS_MsgPtr)sendPtr, SUCCESS); ! } ! task void sendVarLenFailTask() { ! txCount = 0; ! state = IDLE; ! signal SendVarLenPacket.sendDone((uint8_t*)sendPtr, FAIL); ! } ! task void sendVarLenSuccessTask() { ! txCount = 0; ! state = IDLE; ! signal SendVarLenPacket.sendDone((uint8_t*)sendPtr, SUCCESS); ! } - void sendComplete(result_t success) { ! if (state == PACKET) { ! TOS_MsgPtr msg = (TOS_MsgPtr)sendPtr; /* This is a non-ack based layer */ ! if (success) { ! msg->ack = TRUE; ! post sendDoneSuccessTask(); ! } else { ! post sendDoneFailTask(); ! } ! } ! else if (state == BYTES) { ! if (success) { ! post sendVarLenSuccessTask(); ! } ! else { ! post sendVarLenFailTask(); } ! } ! else { ! txCount = 0; ! state = IDLE; ! } ! } ! default event result_t SendVarLenPacket.sendDone(uint8_t* packet, result_t success) { ! return success; ! } ! default event result_t Send.sendDone(TOS_MsgPtr msg, result_t success){ ! return success; ! } /* Byte level component signals it is ready to accept the next byte. Send the next byte if there are data pending to be sent */ ! async event result_t ByteComm.txByteReady(bool success) { - if (txCount > 0) - { - if (!success) - { dbg(DBG_ERROR, "TX_packet failed, TX_byte_failed"); sendComplete(FAIL); ! } ! else if (txCount < txLength) ! { dbg(DBG_PACKET, "PACKET: byte sent: %x, COUNT: %d\n", sendPtr[txCount], txCount); ! if (!call ByteComm.txByte(sendPtr[txCount++])) sendComplete(FAIL); ! } } ! return SUCCESS; ! } ! async event result_t ByteComm.txDone() { ! if (txCount == txLength) ! sendComplete(TRUE); ! return SUCCESS; ! } --- 208,328 ---- } } ! return FAIL; } /* Command to transmit a packet */ ! command result_t Send.send(TOS_MsgPtr msg) { ! state = PACKET; ! msg->crc = 1; /* Fake out the CRC as passed. */ ! return call txBytes((uint8_t *)msg, TOS_MsgLength(msg->type)); ! } /* Command to transfer a variable length packet */ ! command result_t SendVarLenPacket.send(uint8_t* packet, uint8_t numBytes) { ! state = BYTES; ! return call txBytes(packet, numBytes); ! } ! task void sendDoneFailTask() { ! txCount = 0; ! state = IDLE; ! signal Send.sendDone((TOS_MsgPtr)sendPtr, FAIL); ! } ! task void sendDoneSuccessTask() { ! txCount = 0; ! state = IDLE; ! signal Send.sendDone((TOS_MsgPtr)sendPtr, SUCCESS); ! } ! task void sendVarLenFailTask() { ! txCount = 0; ! state = IDLE; ! signal SendVarLenPacket.sendDone((uint8_t*)sendPtr, FAIL); ! } ! ! task void sendVarLenSuccessTask() { ! ! txCount = 0; ! state = IDLE; ! signal SendVarLenPacket.sendDone((uint8_t*)sendPtr, SUCCESS); ! } ! void sendComplete(result_t success) { ! if (state == PACKET) { ! ! TOS_MsgPtr msg = (TOS_MsgPtr)sendPtr; /* This is a non-ack based layer */ ! if (success) { ! msg->ack = TRUE; ! post sendDoneSuccessTask(); ! } else { ! post sendDoneFailTask(); ! } ! } else if (state == BYTES) { ! if (success) { ! post sendVarLenSuccessTask(); ! } else { ! post sendVarLenFailTask(); ! } ! } else { ! txCount = 0; ! state = IDLE; } ! } ! default event result_t SendVarLenPacket.sendDone(uint8_t* packet, result_t success) { ! return success; ! } ! default event result_t Send.sendDone(TOS_MsgPtr msg, result_t success){ ! return success; ! } /* Byte level component signals it is ready to accept the next byte. Send the next byte if there are data pending to be sent */ ! async event result_t ByteComm.txByteReady(bool success) { ! ! if (txCount > 0) { ! ! if (!success) { dbg(DBG_ERROR, "TX_packet failed, TX_byte_failed"); sendComplete(FAIL); ! } else if (txCount < txLength) { ! dbg(DBG_PACKET, "PACKET: byte sent: %x, COUNT: %d\n", sendPtr[txCount], txCount); ! if (!call ByteComm.txByte(sendPtr[txCount++])) { sendComplete(FAIL); ! } ! } } ! return SUCCESS; ! } ! async event result_t ByteComm.txDone() { ! if (txCount == txLength) { ! sendComplete(TRUE); ! } ! return SUCCESS; ! } *************** *** 324,328 **** /** FIXME: tmp is unused. */ ! TOS_Msg* tmp = signal Receive.receive(bufferPtr); state_gps_pkt = NO_GPS_START_BYTE; } --- 334,338 ---- /** FIXME: tmp is unused. */ ! TOS_Msg * tmp = signal Receive.receive(bufferPtr); state_gps_pkt = NO_GPS_START_BYTE; } *************** *** 331,341 **** * Byte received from GPS * First byte in gps packet is reserved to count number of bytes rcvd. ! * Gps messages start with '$' (0x24) and end with <cr><lf> (0x0D, 0x0A) */ async event result_t ByteComm.rxByteReady(uint8_t data, bool error, ! uint16_t strength) { ! //SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); if (error) { --- 341,354 ---- * Byte received from GPS * First byte in gps packet is reserved to count number of bytes rcvd. ! * Gps messages start with '$' (0x24) and end with <cr><lf> (0x0D, 0x0A), ! * which are defined in the header file. */ async event result_t ByteComm.rxByteReady(uint8_t data, bool error, ! uint16_t strength) { + //SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); ! //FIXME: See if this works, remove global if possible. ! //static uint16_t rxCount = 0; if (error) { *************** *** 358,362 **** recPtr[rxCount++] = data; recPtr[0] = rxCount; ! if (rxCount == GPS_DATA_LENGTH ) { --- 371,376 ---- recPtr[rxCount++] = data; recPtr[0] = rxCount; ! ! /** Hopefully, rxCount won't ever exceed GPS_DATA_LENGTH */ if (rxCount == GPS_DATA_LENGTH ) { *************** *** 374,378 **** // bufferIndex = bufferIndex ^ 1; ! // recPtr = (uint8_t*)bufferPtr; ping pong buffers !!!!!!!!!!!!!!!!!! // SODbg(DBG_USR2, "got gps packet; # of bytes = %i \n", rxCount); // rxCount = 0; --- 388,392 ---- // bufferIndex = bufferIndex ^ 1; ! // recPtr = (uint8_t*)bufferPtr; ping pong buffers !!!!!!!!!!!!!!!!!! // SODbg(DBG_USR2, "got gps packet; # of bytes = %i \n", rxCount); // rxCount = 0; *************** *** 417,421 **** event result_t PowerSwitch.setDone(bool local_result) { - if (state_gps == GPS_PWR_SWITCH_WAIT) { if (call PowerSwitch.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { --- 431,434 ---- *************** *** 432,436 **** event result_t PowerSwitch.getDone(char value) { ! return SUCCESS; } --- 445,449 ---- event result_t PowerSwitch.getDone(char value) { ! return SUCCESS; } *************** *** 439,454 **** event result_t IOSwitch.setDone(bool local_result) { ! if (state_gps == GPS_TX_SWITCH_WAIT) { ! if (call IOSwitch.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_RX_SWITCH_WAIT; ! } ! } ! else if (state_gps == GPS_RX_SWITCH_WAIT) { ! SODbg(DBG_USR2, "GpsPacket: all switches set \n"); ! state_gps = GPS_SWITCH_IDLE; ! signal GpsCmd.SwitchesSet(state_gps); ! } ! return SUCCESS; } --- 452,466 ---- event result_t IOSwitch.setDone(bool local_result) { ! if (state_gps == GPS_TX_SWITCH_WAIT) { ! if (call IOSwitch.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_RX_SWITCH_WAIT; ! } ! } else if (state_gps == GPS_RX_SWITCH_WAIT) { ! SODbg(DBG_USR2, "GpsPacket: all switches set \n"); ! state_gps = GPS_SWITCH_IDLE; ! signal GpsCmd.SwitchesSet(state_gps); ! } ! return SUCCESS; } Index: gps.h =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/gps/gps.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gps.h 11 Nov 2003 01:59:40 -0000 1.1 --- gps.h 12 Nov 2003 01:44:20 -0000 1.2 *************** *** 69,74 **** #define GPS_DATA_LENGTH 128 #define GPS_PACKET_START 0x24 //start of gps packet ! #define GPS_PACKET_END1 0x0D //end if gps packet ! #define GPS_PACKET_END2 0x0A //end of gps packet // This isn't used yet, but should be. #define GPS_POWER_OFF 0 --- 69,74 ---- #define GPS_DATA_LENGTH 128 #define GPS_PACKET_START 0x24 //start of gps packet ! #define GPS_PACKET_END1 0x0D //penultimate byte of gps packet ! #define GPS_PACKET_END2 0x0A //last byte of gps packet // This isn't used yet, but should be. #define GPS_POWER_OFF 0 --- SensirionHumidity.nc DELETED --- --- SensirionHumidityM.nc DELETED --- --- TempHum.nc DELETED --- --- TempHumM.nc DELETED --- |
From: <do...@us...> - 2003-11-12 00:11:51
|
Update of /cvsroot/firebug/mts400/sensors/gps In directory sc8-pr-cvs1:/tmp/cvs-serv7855/sensors/gps Modified Files: GpsPacket.nc UARTGpsPacket.nc Log Message: GPS code appears to running by itself now. Index: GpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/gps/GpsPacket.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GpsPacket.nc 11 Nov 2003 01:59:40 -0000 1.1 --- GpsPacket.nc 12 Nov 2003 00:11:47 -0000 1.2 *************** *** 72,75 **** --- 72,76 ---- module GpsPacket { + provides { interface StdControl as Control; *************** *** 93,102 **** interface StdControl as SwitchControl; ! interface Switch as Switch1; ! interface Switch as SwitchI2W; } } implementation { --- 94,104 ---- interface StdControl as SwitchControl; ! interface Switch as PowerSwitch; ! interface Switch as IOSwitch; } } + implementation { *************** *** 180,183 **** --- 182,188 ---- } + /** FIXME: Explain why we would want to transmit bytes, instead + * of just reading bytes. + */ command result_t txBytes(uint8_t *bytes, uint8_t numBytes) { *************** *** 331,335 **** uint16_t strength) { ! //SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); if (error) { --- 336,341 ---- uint16_t strength) { ! ! //SODbg(DBG_USR2, "PACKET: byte arrived: %x, COUNT: %i\n", data, rxCount); if (error) { *************** *** 391,403 **** if (state_gps == GPS_SWITCH_IDLE){ - power_gps = PowerState; if (power_gps){ ! if (call Switch1.set(MICAWB_GPS_POWER,0) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } } else { ! if (call Switch1.set(MICAWB_GPS_POWER,1) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } --- 397,408 ---- if (state_gps == GPS_SWITCH_IDLE){ power_gps = PowerState; if (power_gps){ ! if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } } else { ! if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; } *************** *** 409,429 **** ! /** Power or Enabled switch set */ ! event result_t Switch1.setDone(bool local_result) { ! if (state_gps == GPS_PWR_SWITCH_WAIT) { ! if (call Switch1.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { ! state_gps = GPS_EN_SWITCH_WAIT; ! } ! } else if (state_gps == GPS_EN_SWITCH_WAIT) { ! if (call SwitchI2W.set( MICAWB_GPS_TX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_TX_SWITCH_WAIT; ! } ! } ! return SUCCESS; } ! event result_t Switch1.getDone(char value) { return SUCCESS; } --- 414,435 ---- ! /** Power or Enabled switch set */ ! event result_t PowerSwitch.setDone(bool local_result) { ! ! if (state_gps == GPS_PWR_SWITCH_WAIT) { ! if (call PowerSwitch.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { ! state_gps = GPS_EN_SWITCH_WAIT; ! } ! } else if (state_gps == GPS_EN_SWITCH_WAIT) { ! if (call IOSwitch.set( MICAWB_GPS_TX_SELECT ,power_gps) == SUCCESS) { ! state_gps = GPS_TX_SWITCH_WAIT; ! } ! } ! return SUCCESS; } ! event result_t PowerSwitch.getDone(char value) { return SUCCESS; } *************** *** 431,438 **** // Tx or Rx switch set ! event result_t SwitchI2W.setDone(bool local_result) { if (state_gps == GPS_TX_SWITCH_WAIT) { ! if (call SwitchI2W.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { state_gps = GPS_RX_SWITCH_WAIT; } --- 437,444 ---- // Tx or Rx switch set ! event result_t IOSwitch.setDone(bool local_result) { if (state_gps == GPS_TX_SWITCH_WAIT) { ! if (call IOSwitch.set( MICAWB_GPS_RX_SELECT ,power_gps) == SUCCESS) { state_gps = GPS_RX_SWITCH_WAIT; } *************** *** 447,460 **** } ! event result_t SwitchI2W.setAllDone(bool local_result) { return SUCCESS; } ! event result_t Switch1.setAllDone(bool local_result) { return SUCCESS; } ! event result_t SwitchI2W.getDone(char value) { return SUCCESS; } --- 453,466 ---- } ! event result_t IOSwitch.setAllDone(bool local_result) { return SUCCESS; } ! event result_t PowerSwitch.setAllDone(bool local_result) { return SUCCESS; } ! event result_t IOSwitch.getDone(char value) { return SUCCESS; } Index: UARTGpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/mts400/sensors/gps/UARTGpsPacket.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UARTGpsPacket.nc 11 Nov 2003 01:59:40 -0000 1.1 --- UARTGpsPacket.nc 12 Nov 2003 00:11:47 -0000 1.2 *************** *** 97,101 **** Packet.SwitchControl -> MicaWbSwitch.StdControl; ! Packet.Switch1 -> MicaWbSwitch.Switch[0]; ! Packet.SwitchI2W -> MicaWbSwitch.Switch[1]; } --- 97,101 ---- Packet.SwitchControl -> MicaWbSwitch.StdControl; ! Packet.PowerSwitch -> MicaWbSwitch.Switch[0]; ! Packet.IOSwitch -> MicaWbSwitch.Switch[1]; } |
From: <do...@us...> - 2003-11-12 00:11:50
|
Update of /cvsroot/firebug/mts400/apps/TestGPS In directory sc8-pr-cvs1:/tmp/cvs-serv7855/apps/TestGPS Modified Files: gps_newM.nc Log Message: GPS code appears to running by itself now. Index: gps_newM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestGPS/gps_newM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gps_newM.nc 11 Nov 2003 01:58:36 -0000 1.1 --- gps_newM.nc 12 Nov 2003 00:11:47 -0000 1.2 *************** *** 15,19 **** // new stuff for using gps without sensirion ! //interface StdControl as SwitchControl; interface Switch as PowerSwitch; interface Switch as IOSwitch; --- 15,19 ---- // new stuff for using gps without sensirion ! interface StdControl as SwitchControl; interface Switch as PowerSwitch; interface Switch as IOSwitch; *************** *** 23,28 **** interface I2CSwitchCmds as GpsCmd; ! interface BareSendMsg as GpsSend; ! interface ReceiveMsg as GpsReceive; } } --- 23,28 ---- interface I2CSwitchCmds as GpsCmd; ! interface BareSendMsg as GpsSend; ! interface ReceiveMsg as GpsReceive; } } |
From: <do...@us...> - 2003-11-11 02:00:12
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1:/tmp/cvs-serv8939/web Modified Files: gps_driver.html Log Message: Added p-code to gps web page. Index: gps_driver.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/gps_driver.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gps_driver.html 1 Aug 2003 17:32:28 -0000 1.10 --- gps_driver.html 11 Nov 2003 02:00:08 -0000 1.11 *************** *** 18,21 **** --- 18,33 ---- <p>FireBug uses the <tt>gps</tt> driver to interface with a GPS receiver and handle location information.</p> + + <p>Some pseudo-code for GPS driver:</p> + + <ul> + <li>Turn power on I2C Switch 0, S8-D8</li> + <li>Enable GPS I/O on I2C Switch 1: + <ul> + <li>S1-D1 GPS_TX</li> + <li>S2-D2 GPS_RX</li> + </ul> + </li> + </ul> <h2>Introduction</h2> |
From: <do...@us...> - 2003-11-11 01:59:15
|
Update of /cvsroot/firebug/mts400/sensors/gps In directory sc8-pr-cvs1:/tmp/cvs-serv8703/gps Log Message: Directory /cvsroot/firebug/mts400/sensors/gps added to the repository |
From: <do...@us...> - 2003-11-11 01:58:39
|
Update of /cvsroot/firebug/mts400/apps/TestGPS In directory sc8-pr-cvs1:/tmp/cvs-serv8617/TestGPS Added Files: .cvsignore Makefile gps_new.nc gps_newM.nc Log Message: Added gps test application. --- NEW FILE: .cvsignore --- build *~ --- NEW FILE: Makefile --- COMPONENT=gps_new SENSORBOARD=gps include ../Makelocal include $(TOSROOT)/apps/Makerules --- NEW FILE: gps_new.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ includes sensorboard; configuration gps_new { #if 0 provides { interface SplitControl; } #endif } implementation { components Main, gps_newM, MicaWbSwitch, UARTGpsPacket, TimerC, // NoLeds, LedsC; Main.StdControl -> gps_newM.StdControl; Main.StdControl -> TimerC.StdControl; Main.StdControl -> MicaWbSwitch.StdControl; //Easy stuff gps_newM.Leds -> LedsC; gps_newM.Timer -> TimerC.Timer[unique("Timer")]; /** New stuff for using gps without sensirion. */ //gps_newM.SwitchControl -> MicaWbSwitch.StdControl; gps_newM.PowerSwitch -> MicaWbSwitch.Switch[0]; gps_newM.IOSwitch -> MicaWbSwitch.Switch[1]; gps_newM.GpsControl -> UARTGpsPacket; gps_newM.GpsSend -> UARTGpsPacket; gps_newM.GpsReceive -> UARTGpsPacket; gps_newM.GpsCmd -> UARTGpsPacket.GpsCmd; } --- NEW FILE: gps_newM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ module gps_newM { provides { interface StdControl; } uses { interface Timer; interface Leds; // new stuff for using gps without sensirion //interface StdControl as SwitchControl; interface Switch as PowerSwitch; interface Switch as IOSwitch; interface StdControl as GpsControl; //interface SplitControl as GpsControl; interface I2CSwitchCmds as GpsCmd; interface BareSendMsg as GpsSend; interface ReceiveMsg as GpsReceive; } } implementation { #include "SODebug.h" #include "gps.h" char state; enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, OPENSCK, OPENDATA, CLOSESCK, CLOSEDATA, POWEROFF, MAIN_SWITCH_ON, MAIN_SWITCH_OFF, WAIT_SWITCH_ON, WAIT_SWITCH_OFF, TIMER}; /**** StdControl **/ command result_t StdControl.init() { init_debug(); call Leds.init(); /* Control.init in GpsPacket.nc */ call GpsControl.init(); return SUCCESS; } command result_t StdControl.start() { /* Control.start in GpsPacket.nc */ call GpsControl.start(); /* Implementation is in GpsPacket.nc */ if (!call GpsCmd.PowerSwitch(GPS_POWER_ON)) { SODbg(DBG_USR2, "Failed to power on gps \n"); } call Timer.start(TIMER_REPEAT, 1000) ; return SUCCESS; } command result_t StdControl.stop() { return call Timer.stop(); //return SUCCESS; } /****************************************************/ /** Timer */ event result_t Timer.fired() { call Leds.greenToggle(); return SUCCESS; } /****************************************************/ /** PowerSwitch */ event result_t PowerSwitch.getDone(char value) { return SUCCESS; } event result_t PowerSwitch.setDone(bool local_result) { switch(state) { case MAIN_SWITCH_ON: state = IDLE; //signal GpsControl.startDone(); break; case MAIN_SWITCH_OFF: state = POWEROFF; //signal GpsControl.stopDone(); break; case WAIT_SWITCH_ON: if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { state = MAIN_SWITCH_ON; } break; case WAIT_SWITCH_OFF: if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { state = MAIN_SWITCH_OFF; } default: break; } return SUCCESS; } event result_t PowerSwitch.setAllDone(bool local_result) { return SUCCESS; } /****************************************************/ /** IOSwitch */ //#if 0 event result_t IOSwitch.getDone(char value) { return SUCCESS; } event result_t IOSwitch.setAllDone(bool local_result) { return SUCCESS; } event result_t IOSwitch.setDone(bool local_result) { SODbg(DBG_USR2, "SensirionHumidityM.SwitchI2W: state: %i \n", state); if (state == OPENSCK) { //SCK line enabled state = OPENDATA; return call IOSwitch.set(MICAWB_HUMIDITY_DATA,1); } else if (state == OPENDATA) { //Data line enabled state = TIMER; SODbg(DBG_USR2, "SensirionHumidityM.SwitchI2W: Timer Started \n"); return call Timer.start(TIMER_ONE_SHOT, 100); } else if (state == CLOSESCK) { state = CLOSEDATA; return call IOSwitch.set(MICAWB_HUMIDITY_DATA,0); } else if (state == CLOSEDATA) { } return SUCCESS; } //#endif /** * Packet received from GPS - ASCII msg * 1st byte in pkt is number of ascii bytes * async used only for testing */ event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; call Leds.greenToggle(); for (i=0; i<=gps_data->data[0]; i++) { UARTPutChar(gps_data->data[i]); } SODbg(DBG_USR2, "\n"); return data; } event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { return SUCCESS; } event result_t GpsCmd.SwitchesSet(uint8_t PowerState) { SODbg(DBG_USR2, "Gps power on \n"); call Leds.yellowOn(); call Leds.redOff(); return SUCCESS; } } |
From: <do...@us...> - 2003-11-11 01:58:39
|
Update of /cvsroot/firebug/mts400/apps/TestSensirion In directory sc8-pr-cvs1:/tmp/cvs-serv8617/TestSensirion Modified Files: SensirionM.nc Log Message: Added gps test application. Index: SensirionM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestSensirion/SensirionM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SensirionM.nc 5 Nov 2003 15:57:00 -0000 1.1 --- SensirionM.nc 11 Nov 2003 01:58:36 -0000 1.2 *************** *** 57,61 **** call Leds.init(); call TempHumControl.init(); //init Sensirion - //call PressureControl.init(); // init Intersema return SUCCESS; } --- 57,60 ---- |
From: <do...@us...> - 2003-11-05 16:06:44
|
Update of /cvsroot/firebug/mts400/apps/TestSensirion In directory sc8-pr-cvs1:/tmp/cvs-serv3919/mts400/apps/TestSensirion Added Files: .cvsignore Makefile Sensirion.nc SensirionM.nc Log Message: Started adding individual test applications for the sensors on the fireboard. --- NEW FILE: .cvsignore --- build *~ --- NEW FILE: Makefile --- COMPONENT=Sensirion SENSORBOARD=sensirion include ../Makelocal include $(TOSROOT)/apps/Makerules --- NEW FILE: Sensirion.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * Sensirion SHT11 driver test application. * * The Sensirion SHT11 sensor is manufactured by: * * Sensirion AG * Eggbuehlstrasse 14 * CH-8052 Zurich * Switzerland * Telephone +41 (0)1 306 40 00 * Fax +41 (0)1 306 40 30 * in...@se... * http://www.sensirion.com * * Spec sheet is located at: * @url http://www.sensirion.com/en/sensors/humidity/sensors_devices/sensorSHT11.htm * * Characteristics of the sensor, from the web page given above: * * - 2 sensors for relative humidity & temperature * - Precise dewpoint calculation possible * - Measurement range: 0-100% RH * - Absolute RH accuracy: +/- 3.5% RH * - Temp. accuracy: +/- 0.5°C @ 25 °C * - Calibrated & digital output (2-wire interface) * - Fast response time < 4 sec. * - Low power consumption (typ. 30 µW) * - Low cost * * From the PDF spec sheet, the combined sensor is 14 bit ADC. * * ===== Relative humidity ===== * Range: 0 to 100 % RH * Accuracy: +- 3.5 % RH (20 to 80% RH) * Response time: =< 4 sec. * Reproducibility: +- 0.1 % RH * Resolution: 0.03 % RH * Operating temperature: -40 to 120 C * * ===== Temperature ===== * Range: -40 to 120 C * Accuracy: +- 0.5 C @ 25 C, +- 0.9 C (0 to -40 C) * Response time: =< 20 sec. * Reproducibility: +- 0.1 C * Resolution: 0.01 C * * ===== Electrical ===== * Power consumption: * 30 uW @5V, 12 bit, 2 sec. sampling * 1 uW @2.4V, 8 bit, 2 min. sampling * * Supply Voltage range: 2.4 to 5.5 V * * Measurement input current: 0.5 mA * Standby input current: 0.3 uA * * ===== Physics ===== * Might have to get patent data for this stuff. * * The temperature sensor works by: * * * The humidity sensor works by: * * * Misc. SHT11 is a surface mountable CMOS component. * They claim it is pre-calibrated. */ configuration Sensirion { } implementation { components Main, SensirionM, SensirionHumidity, MicaWbSwitch, TimerC, NoLeds, LedsC; Main.StdControl -> SensirionM; Main.StdControl -> TimerC; // Wiring for Sensirion humidity/temperature sensor SensirionM.TempHumControl -> SensirionHumidity; SensirionM.Humidity -> SensirionHumidity.Humidity; SensirionM.Temperature -> SensirionHumidity.Temperature; SensirionM.HumidityError -> SensirionHumidity.HumidityError; SensirionM.TemperatureError -> SensirionHumidity.TemperatureError; SensirionM.Leds -> LedsC; SensirionM.Timer -> TimerC.Timer[unique("Timer")]; } --- NEW FILE: SensirionM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /* History: created 1/25/2001 */ /****************************************************************************** * Measures MTS400/420 weatherboard sensors & gps and converts to engineering units * were possible. *----------------------------------------------------------------------------- * Output results through mica2 uart port. Connect serial cable from programming * board to PC to monitor ouput. Use any terminal monitoring program set for * 57600, N,8,1 * * NOTE: * No real power strategy; just turns sensors on sequentially. * Should add BusArbitration routines, like mica2dotwb for better power control *****************************************************************************/ module SensirionM { provides interface StdControl; uses { //Sensirion interface SplitControl as TempHumControl; interface ADC as Humidity; interface ADC as Temperature; interface ADCError as HumidityError; interface ADCError as TemperatureError; interface Timer; interface Leds; } } implementation { #include "SODebug.h" enum {START, BUSY, HUMIDITY_DONE}; char count; uint16_t calibration[6]; uint16_t C1,C2,C3,C4,C5,C6; //intersema calibration coefficients uint16_t HumData; uint8_t state; command result_t StdControl.init() { init_debug(); call Leds.init(); call TempHumControl.init(); //init Sensirion //call PressureControl.init(); // init Intersema return SUCCESS; } command result_t StdControl.start() { call HumidityError.enable(); //in case Sensirion doesn't respond call TemperatureError.enable(); // " call Leds.redOn(); call Leds.yellowOn(); call Leds.greenOn(); state = START; call Timer.start(TIMER_REPEAT, 1000); //start up weather sensor measurements return SUCCESS; } command result_t StdControl.stop() { return SUCCESS; } /****************************************************************************** * Timer fired, test GPS, humidity/temp * async for test only *****************************************************************************/ event result_t Timer.fired() { call Leds.redOff(); call Leds.yellowOff(); call Leds.greenOff(); call TempHumControl.start(); return SUCCESS; } /****************************************************************************** * Sensirion SHT11 humidity/temperature sensor * - Humidity data is 12 bit: * Linear calc (no temp correction) * fRH = -4.0 + 0.0405 * data -0.0000028 * data^2 'RH linear * With temperature correction: * fRH = (fTemp - 25) * (0.01 + 0.00008 * data) + fRH 'RH true * - Temperature data is 14 bit * Temp(degC) = -38.4 + 0.0098 * data *****************************************************************************/ async event result_t Temperature.dataReady(uint16_t data) { float fTemp, fHumidity; fTemp = -38.4 + 0.0098*(float)data; atomic { fHumidity = -4.0 + 0.0405 * HumData -0.0000028 * HumData * HumData; fHumidity= (fTemp-25.0)* (0.01 + 0.00008 * HumData) + fHumidity; } fTemp = 10*fTemp; SODbg(DBG_USR2, "Humidity: Temp(adc): %i Humidity(adc): %i Temp(degCx10): %i Humidity(%): %i \n", data,HumData,(int)fTemp, (int)fHumidity); atomic { call TempHumControl.stop(); } return SUCCESS; } async event result_t Humidity.dataReady(uint16_t data) { atomic { HumData = data; } return call Temperature.getData(); } event result_t TempHumControl.startDone() { call Humidity.getData(); return SUCCESS; } event result_t TempHumControl.initDone() { return SUCCESS; } event result_t TempHumControl.stopDone() { state = HUMIDITY_DONE; return SUCCESS; } event result_t HumidityError.error(uint8_t token) { call Leds.redOff(); call Leds.yellowOff(); call Temperature.getData(); return SUCCESS; } event result_t TemperatureError.error(uint8_t token) { call TempHumControl.stop(); call Leds.yellowOff(); return SUCCESS; } } |
From: <do...@us...> - 2003-11-05 16:03:03
|
Update of /cvsroot/firebug/mts400/apps In directory sc8-pr-cvs1:/tmp/cvs-serv3919/mts400/apps Added Files: Makelocal Log Message: Started adding individual test applications for the sensors on the fireboard. --- NEW FILE: Makelocal --- #LOCAL_PATH += -I$(XBOWROOT)/tos/platform -I$(XBOWROOT)/tos/interfaces -I$(XBOWROOT)/tos/sensorboards/$(SENSORBOARD) LOCAL_PATH += -I../../sensors/$(SENSORBOARD) PFLAGS := $(LOCAL_PATH) $(LOCAL_DEFINES) $(PFLAGS) CFLAGS = -DCC1K_DEFAULT_FREQ=CC1K_433_002_MHZ |
From: <che...@us...> - 2003-11-05 05:14:56
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv3317 Modified Files: Makefile Added Files: CollectDataFB_gps.nc CollectDataMFB_gps.nc Log Message: rename to CollectDataFB/MFB if run it --- NEW FILE: CollectDataFB_gps.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * Author: Terence Tong, Alec Woo, Max Min Chen, David M. Doolin */ includes RoutingStack; configuration CollectDataFB { } implementation { components Main, CollectDataMFB, MHSender, LedsC,MicaWbSwitch, VirtualComm, ParentSelection,UARTGpsPacket, TimerWrapper,//Logger, Accel;//CC1000ControlM Main.StdControl -> CollectDataMFB.StdControl; CollectDataMFB.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; CollectDataMFB.Timer1 -> TimerWrapper.Timer[unique("Timer")]; CollectDataMFB.Timer2 -> TimerWrapper.Timer[unique("Timer")]; CollectDataMFB.Leds -> LedsC; Main.StdControl -> MHSender.StdControl; // Wiring for gps CollectDataMFB.GpsControl -> UARTGpsPacket; CollectDataMFB.GpsSend -> UARTGpsPacket; CollectDataMFB.GpsReceive -> UARTGpsPacket; CollectDataMFB.GpsCmd -> UARTGpsPacket.GpsCmd; // Wiring for Accelerometer CollectDataMFB.AccelControl->Accel.StdControl; CollectDataMFB.AccelCmd -> Accel.AccelCmd; } --- NEW FILE: CollectDataMFB_gps.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil; font-lock-mode: t -*- */ /** * This is an example of a general application using the * Routing Stack to send message to * basestation. It store a message in its frame, * call getUsablePortion to get the right location * to add in its own data. passed the data down * the stack with the send command. A Send done * command will come back. A recomment way to send * another message is to have a one shot * Time. When the clock fired, we make another * attempt to send again. * * @author: Terence Tong, Alec Woo, Max Min Chen */ includes RoutingStack; //includes gps; #define GPS_MSG_LENGTH 100 #define GPS_CHAR 11 #define GPS_FIELDS 8 #define GPS_CHAR_PER_FIELD 10 #define GPS_DELIMITER ',' #define GPS_END_MSG '*' module CollectDataMFB { provides { interface StdControl; command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length); command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]); } uses { interface Send as MultiHopSend; interface Timer as Timer1; interface Timer as Timer2; interface Leds; interface I2CSwitchCmds as GpsCmd; interface StdControl as GpsControl; interface BareSendMsg as GpsSend; interface ReceiveMsg as GpsReceive; //Accels interface StdControl as AccelControl; interface I2CSwitchCmds as AccelCmd; } } #define DATA_FREQ 10000 implementation { #include "SODebug.h" #include "gps.h" TOS_Msg msgToSend; //GPS_MsgPtr gps_data; struct DataFormat_t { uint16_t addr; uint16_t cnt; float temp; float rel_hum; float baro_pres; }; uint16_t counter; uint8_t sending; char count; bool gps_active; //true if gps is active command result_t StdControl.init() { gps_active = TRUE; init_debug(); call Leds.init(); call GpsControl.init(); call AccelControl.init(); //initialize accelerometer return SUCCESS; } command result_t StdControl.start() { int i; counter = 0; call GpsControl.start(); SODbg(DBG_USR2, "Power GPS... \n"); call Timer1.start(TIMER_REPEAT, 5000); //if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power // call Leds.yellowToggle(); // SODbg(DBG_USR2, "Failed to power on gps \n"); //} call Leds.redToggle(); for (i = 0; i < 29; i++) { msgToSend.data[i] = 0; } return SUCCESS; } command result_t StdControl.stop() { return SUCCESS; } event result_t Timer1.fired() { //call GpsCmd.GpsPower(1); if (! call GpsCmd.PowerSwitch(1)) { //turn on GPS power call Leds.yellowToggle(); SODbg(DBG_USR2, "Failed to power on gps \n"); } return SUCCESS; } /** * When the clock fired we are ready to send, CollectData ask the stack * where in the data payload we can safely put our data. We then call * Multihop passed the pointer down the stack * * @author: terence * @param: void * @return: always return success */ event result_t Timer2.fired() { uint8_t *dataPortion; uint16_t availableLength = 0; struct DataFormat_t *df; if (sending == 1) { return SUCCESS; } dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; df->cnt = counter++; //df->temp = gps_data->data[0]; //df->rel_hum = gps_data->data[1]; //df->baro_pres = gps_data->data[2]; sending = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); return SUCCESS; } /** * When a message is sent, send done event is trigger. We then schedule the * time to generate another message to send * * @author: terence * @param: void * @return: void */ event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; call Timer2.stop(); return SUCCESS; } // ************************** //*Packet received from GPS* //************************** // //*The following should be executed in GpsPacket event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { int8_t gga_string[GPS_MSG_LENGTH]; bool gga_read = FALSE; bool gga_read_done = FALSE; uint16_t i = 0; uint8_t j = 0; uint8_t k = 0; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; SODbg(DBG_USR2, "gps_data:%i,\n", gps_data->length); for (k = 0; k <= gps_data->length ; k++) UARTPutChar(gps_data->data[k]); SODbg(DBG_USR2, "\n"); while (!gga_read_done) { if(gps_data->data[i] == 'G') { if(gps_data->data[i+1] == 'G') { if(gps_data->data[i+2] == 'A') { gga_read = TRUE; } } } if(gps_data->data[i] == GPS_END_MSG) { if(gga_read) { if(call GpsCmd.PowerSwitch(0)) { SODbg(DBG_USR2, "GPS Power Off\n"); } call parseGPS(gga_string, j); gga_read = FALSE; gga_read_done = TRUE; } } if(gga_read) { gga_string[j] = gps_data->data[i]; j++; } i++; } call Leds.greenToggle(); return data; } //**************** //*Parse GPS Data* //**************** //* //* Fields are comma delimited //* NMEA string parsed by field and stored into //* gga_fields array command result_t parseGPS(int8_t gga_string[GPS_MSG_LENGTH], uint8_t length) { char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]; bool end_of_field = FALSE; uint8_t i=0; uint8_t j,m; uint16_t k=0; //***DEBUG: Output NMEA message*** uint16_t q; SODbg(DBG_USR2, "parse GPS: \n"); for(q=0; q<length; q++) UARTPutChar(gga_string[q]); SODbg(DBG_USR2, "\n"); //******************************** // Parse and store comma delimited fields into EEPROM while (i < GPS_FIELDS) { // assemble gga_fields array end_of_field = FALSE; j = 0; while (!end_of_field & k < length) { if (gga_string[k] == GPS_DELIMITER) { end_of_field = TRUE; } else { gga_fields[i][j] = gga_string[k]; } j++; k++; } // two commas (,,) indicate empty field // if field is empty, set it equal to 0 if (j <= 1) { for (m=0; m<10; m++) gga_fields[i][m] = '0'; } i++; } call logGPS(gga_fields); return SUCCESS; } // ************** //*Log GGA data* //************** //* //* Assemble GGA message structure from gga_fields //* Store GGA data into line 25 of EEPROM command result_t logGPS(char gga_fields[GPS_FIELDS][GPS_CHAR_PER_FIELD]) { GGA_Msg *pGGA; char gga_log_array[GPS_CHAR]; char NS; char EW; uint8_t j; uint8_t nos; // number of satellites // Assemble GGA_Msg pGGA->hours = 10*(gga_fields[1][0]-'0') + (gga_fields[1][1]-'0'); gga_log_array[0] = pGGA->hours; pGGA->minutes = 10*(gga_fields[1][2]-'0') + (gga_fields[1][3]-'0'); gga_log_array[1] = pGGA->minutes; pGGA->dec_sec = 10000*(gga_fields[1][4]-'0') + 1000*(gga_fields[1][5]-'0') + 100*(gga_fields[1][7]-'0') + 10*(gga_fields[1][8]-'0') + (gga_fields[1][9]-'0'); gga_log_array[2] = (pGGA->dec_sec)>>8; // MSB gga_log_array[3] = pGGA->dec_sec; // LSB pGGA->Lat_deg = 10*(gga_fields[2][0]-'0') + (gga_fields[2][1]-'0'); gga_log_array[4] = pGGA->Lat_deg; pGGA->Lat_dec_min = 100000*(gga_fields[2][2]-'0') + 10000*(gga_fields[2][3]-'0') + 1000*(gga_fields[2][4]-'0') + 100*(gga_fields[2][5]-'0') + 10*(gga_fields[2][6]-'0') + (gga_fields[2][7]-'0'); gga_log_array[5] = (pGGA->Lat_dec_min)>>8; gga_log_array[6] = pGGA->Lat_dec_min; pGGA->Long_deg = 100*(gga_fields[4][0]-'0') + 10*(gga_fields[4][1]-'0') + (gga_fields[4][2]-'0'); gga_log_array[7] = pGGA->Long_deg; pGGA->Long_dec_min = 100000*(gga_fields[4][3]-'0') + 10000*(gga_fields[4][4]-'0') + 1000*(gga_fields[4][5]-'0') + 100*(gga_fields[4][6]-'0') + 10*(gga_fields[4][7]-'0') + (gga_fields[4][8]-'0'); gga_log_array[8] = (pGGA->Long_dec_min)>>8; gga_log_array[9] = pGGA->Long_dec_min; NS = (gga_fields[3][0] == 'N') ? 1 : 0; EW = (gga_fields[5][0] == 'W') ? 1 : 0; pGGA->NSEWind = EW | (NS<<4); // eg. Status = 000N000E = 00010000 gga_log_array[10] = pGGA->NSEWind; nos = 10*(gga_fields[7][0]-'0') + (gga_fields[7][1]-'0'); //***DEBUG: Output GGA data before gga_fields*** SODbg(DBG_USR2, "LOGGER GPS:\n"); for(j=0; j<11; j++) UARTPutChar(gga_log_array[j]); SODbg(DBG_USR2, "\n"); //***************************************** return SUCCESS; } /****************************************************************************** * Packet received from GPS - ASCII msg * 1st byte in pkt is number of ascii bytes * async used only for testing *****************************************************************************/ //((((((((((((((This is a alternative way from the above)))))))))))))) /* event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { //change to GPS packet!! uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; //gps_data = (GPS_MsgPtr)data; call Leds.greenToggle(); //for (i = 0; i <= gps_data->data[0] ; i++) UARTPutChar(gps_data->data[i]); for (i = 0; i <= gps_data->length ; i++) UARTPutChar(gps_data->data[i]); SODbg(DBG_USR2, "\n"); call Timer2.start(TIMER_ONE_SHOT,300); return data; } */ event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { return SUCCESS; } event result_t GpsCmd.SwitchesSet(uint8_t PowerState){ gps_active = TRUE; call Leds.yellowToggle(); SODbg(DBG_USR2, "Gps power on \n"); return SUCCESS; } event result_t AccelCmd.SwitchesSet(uint8_t PowerState){ return SUCCESS; } } Index: Makefile =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/Makefile,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile 15 Oct 2003 23:14:25 -0000 1.18 --- Makefile 5 Nov 2003 05:14:52 -0000 1.19 *************** *** 1,155 **** ! #/* -*- Mode: Makefile; c-basic-indent: 2; -*- */ ! #/* $Id$ */ ! #/*////////////////////////////////////////////////////////*/ ! #/** ! # * Max Min Chen, David Doolin, Anshuman Sharma ! # */ ! #/*////////////////////////////////////////////////////////*/ ! ! ! #ifndef XBOWROOT ! # echo Please set the XBOWROOT environment variable ! #endif ! ! ! UISP = uisp ! UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! ! ! PLATFORMS= mica mica2 pc ! ! ! INCLUDES=-I$(BLASTROOT)/Sender \ ! -I$(BLASTROOT)/Interface \ ! -I$(BLASTROOT)/DataStructure \ ! -I$(BLASTROOT)/VirtualComm \ ! -I$(BLASTROOT)/ParentSelection \ ! -I$(XBOWROOT)/tos/sensorboards/mts400 \ ! -I$(XBOWROOT)/apps/XsensorMTS400/mts400 \ ! -I$(XBOWROOT)/tos/interfaces ! ! ! ! PFLAGS := $(PFLAGS) -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d ! ! PLATAUX=$(PLATFORMS) all ! PLATFORM := $(filter $(PLATAUX), $(MAKECMDGOALS)) ! PFLAGS := -target=$(PLATFORM) $(PFLAGS) ! MAKECMDGOALS := $(filter-out $(PLATAUX), $(MAKECMDGOALS)) ! BUILDDIR= build/$(PLATFORM) ! MAIN_EXE= $(BUILDDIR)/main.exe ! MAIN_SREC= $(BUILDDIR)/main.srec ! TARGETS= CollectDataFB BaseStation TestMTS400 ! TARGET := $(filter $(TARGETS), $(MAKECMDGOALS)) ! MAKECMDGOALS := $(filter-out $(TARGET), $(MAKECMDGOALS)) ! ! ifeq ($(PLATFORM), pc) ! PFLAGS := -g -O0 -pthread $(PFLAGS) -fnesc-nido-tosnodes=1000 -fnesc-cfile=$(BUILDDIR)/app.c ! MAIN_TARGET = $(MAIN_EXE) ! else ! PFLAGS := -Os $(PFLAGS) -finline-limit=100000 -fnesc-cfile=$(BUILDDIR)/app.c ! MAIN_TARGET = $(MAIN_SREC) ! endif ! ! NCC := ncc -board=micasb ! ! ###################################################################### ! # top-level rules. switch based on MAKECMDGOALS ! ###################################################################### ! ! # ! # rules for make clean ! # ! ifeq ($(MAKECMDGOALS)_x, clean_x) ! ! PLATFORM= ! ! $(PLATAUX): ! @echo "" ! ! else ! ! ifeq ($(PLATFORM)_x,_x) ! $(error $(PLATAUX) $(MAKECMDGOALS) $(USAGE)) ! endif ! ! MAKECMDGOALS := $(patsubst install.%,install,$(MAKECMDGOALS)) ! MAKECMDGOALS := $(patsubst reinstall.%,reinstall,$(MAKECMDGOALS)) ! ! # ! # rules for make install <platform> ! # ! ifeq ($(MAKECMDGOALS)_x, install_x) ! ! $(PLATAUX): ! @true ! ! else ! ifeq ($(MAKECMDGOALS)_x, reinstall_x) ! ! $(PLATAUX): ! @true ! ! else ! all: ! for platform in $(PLATFORMS); do \ ! $(MAKE) $$platform $(DOCS) || exit 1; \ ! done ! ! $(PLATFORMS): build ! ! endif ! endif ! endif ! ! ! ## Make a pc build ! ## -Wshadow warns when globals are shadowed by locals. ! ! build: $(MAIN_TARGET) ! ! install: $(MAIN_SREC) FORCE ! @$(MAKE) $(PLATFORM) re$@ ! ! install.%: $(MAIN_SREC) FORCE ! $(MAKE) $(PLATFORM) re$@ ! ! reinstall: FORCE ! @echo " installing $(PLATFORM) binary" ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(MAIN_SREC) ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(MAIN_SREC) ! ! reinstall.%: FORCE ! @echo " installing $(PLATFORM) binary " ! set-mote-id $(BUILDDIR)/main.srec $(BUILDDIR)/main.srec.out `echo $@ |sed 's:reinstall.::g'` ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(BUILDDIR)/main.srec.out ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(BUILDDIR)/main.srec.out ! ! ! $(MAIN_EXE): $(BUILDDIR) FORCE ! @echo " compiling $(TARGET) to a $(PLATFORM) binary" ! $(NCC) -o $(MAIN_EXE) $(PFLAGS) $(CFLAGS) $(INCLUDES) $(TARGET).nc -lm $(LDFLAGS) ! @echo " compiled $(COMPONENT) to $@" ! @objdump -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if /^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d bytes in RAM\n",$$b{text}+$$b{data},$$b{bss}); }' ! ! $(MAIN_SREC): $(MAIN_EXE) ! avr-objcopy --output-target=srec $(MAIN_EXE) $(MAIN_SREC) ! ! $(BUILDDIR): ! mkdir -p $(BUILDDIR) ! ! clean: ! rm -rf $(BUILDDIR) ! rm -f core.* ! rm -f *~ ! ! ! FORCE: ! ! .phony: FORCE --- 1,173 ---- ! #/* -*- Mode: Makefile; c-basic-indent: 2; -*- */ ! #/* $Id$ */ ! #/*////////////////////////////////////////////////////////*/ ! #/** ! # * Max Min Chen, David Doolin ! # */ ! #/*////////////////////////////////////////////////////////*/ ! ! ## This is the Makefile for multihop. ! ! #ifndef XBOWROOT ! # echo Please set the XBOWROOT environment variable ! #endif ! ! UISP_EXTRA_FLAGS= -dpart=ATmega128 --wr_fuse_e=ff ! UISP = uisp ! UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! TOSROOT=/cygdrive/c/tinyos/cygwin/opt ! BLASTROOT=/cygdrive/c ! XBOWROOT = $(TOSROOT)/tinyos-1.x/contrib/xbow ! ! PLATFORMS= mica mica2 pc ! #DATASTRUCTURE=$(TOSROOT)/broken/experimental/terence/tos/lib/DataStructure ! #ROUTESTACK=$(TOSROOT)/broken/experimental/terence/apps/mh6 ! #INCLUDES=-I$(DATASTRUCTURE) -I$(ROUTESTACK) ! #CC1000=-I/cygdrive/d/tinyos-1.x/tos/platform/mica2 ! ! INCLUDES=-I$(BLASTROOT)/Blast-0.11/Sender \ ! -I$(BLASTROOT)/Blast-0.11/Interface \ ! -I$(BLASTROOT)/Blast-0.11/DataStructure \ ! -I$(BLASTROOT)/Blast-0.11/VirtualComm \ ! -I$(BLASTROOT)/Blast-0.11/ParentSelection \ ! -I$(TOSROOT)/tinyos-1.x/tos \ ! -I$(XBOWROOT)/tos/platform \ ! -I$(XBOWROOT)/tos/interfaces \ ! -I$(XBOWROOT)/tos/sensorboards/mts400 ! ! ! PFLAGS := $(PFLAGS) -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d ! ! PLATAUX=$(PLATFORMS) all ! PLATFORM := $(filter $(PLATAUX), $(MAKECMDGOALS)) ! PFLAGS := -target=$(PLATFORM) $(PFLAGS) ! MAKECMDGOALS := $(filter-out $(PLATAUX), $(MAKECMDGOALS)) ! BUILDDIR= build/$(PLATFORM) ! MAIN_EXE= $(BUILDDIR)/main.exe ! MAIN_SREC= $(BUILDDIR)/main.srec ! TARGETS= CollectDataFB BaseStation ! TARGET := $(filter $(TARGETS), $(MAKECMDGOALS)) ! MAKECMDGOALS := $(filter-out $(TARGET), $(MAKECMDGOALS)) ! ! ifeq ($(PLATFORM), pc) ! PFLAGS := -g -O0 -pthread $(PFLAGS) -fnesc-nido-tosnodes=1000 -fnesc-cfile=$(BUILDDIR)/app.c ! MAIN_TARGET = $(MAIN_EXE) ! else ! PFLAGS := -Os $(PFLAGS) -finline-limit=100000 -fnesc-cfile=$(BUILDDIR)/app.c -DCC1K_DEFAULT_FREQ=CC1K_433_002_MHZ ! ! MAIN_TARGET = $(MAIN_SREC) ! endif ! ! NCC := ncc -board=mts400 ! ! ###################################################################### ! # top-level rules. switch based on MAKECMDGOALS ! ###################################################################### ! ! # ! # rules for make clean ! # ! ifeq ($(MAKECMDGOALS)_x, clean_x) ! ! PLATFORM= ! ! $(PLATAUX): ! @echo "" ! ! else ! ! ifeq ($(PLATFORM)_x,_x) ! $(error $(PLATAUX) $(MAKECMDGOALS) $(USAGE)) ! endif ! ! MAKECMDGOALS := $(patsubst install.%,install,$(MAKECMDGOALS)) ! MAKECMDGOALS := $(patsubst reinstall.%,reinstall,$(MAKECMDGOALS)) ! ! # ! # rules for make install <platform> ! # ! ifeq ($(MAKECMDGOALS)_x, install_x) ! ! $(PLATAUX): ! @true ! ! else ! ifeq ($(MAKECMDGOALS)_x, reinstall_x) ! ! $(PLATAUX): ! @true ! ! else ! all: ! for platform in $(PLATFORMS); do \ ! $(MAKE) $$platform $(DOCS) || exit 1; \ ! done ! ! $(PLATFORMS): build ! ! endif ! endif ! endif ! ! ! #APPLICATION = CollectDataFB.nc ! #APPLICATION = BaseStation.nc ! ! ! # Uncomment the following to see how the ! # shell variables are set. ! #$DATASTRUCTURE ! #$INCLUDES ! ! ## Make a pc build ! ## -Wshadow warns when globals are shadowed by locals. ! ! ! ! build: $(MAIN_TARGET) ! ! install: $(MAIN_SREC) FORCE ! @$(MAKE) $(PLATFORM) re$@ ! ! install.%: $(MAIN_SREC) FORCE ! $(MAKE) $(PLATFORM) re$@ ! ! reinstall: FORCE ! @echo " installing $(PLATFORM) binary" ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(MAIN_SREC) ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(MAIN_SREC) ! ! reinstall.%: FORCE ! @echo " installing $(PLATFORM) binary " ! set-mote-id $(BUILDDIR)/main.srec $(BUILDDIR)/main.srec.out `echo $@ |sed 's:reinstall.::g'` ! $(UISP) $(UISP_FLAGS) --erase ! sleep 1 ! $(UISP) $(UISP_FLAGS) --upload if=$(BUILDDIR)/main.srec.out ! sleep 1 ! $(UISP) $(UISP_FLAGS) --verify if=$(BUILDDIR)/main.srec.out ! ! ! $(MAIN_EXE): $(BUILDDIR) FORCE ! @echo " compiling $(TARGET) to a $(PLATFORM) binary" ! $(NCC) -o $(MAIN_EXE) $(PFLAGS) $(CFLAGS) $(INCLUDES) $(TARGET).nc -lm $(LDFLAGS) ! @echo " compiled $(COMPONENT) to $@" ! @objdump -h $(MAIN_EXE) | perl -ne '$$b{$$1}=hex $$2 if /^\s*\d+\s*\.(text|data|bss)\s+(\S+)/; END { printf("%16d bytes in ROM\n%16d bytes in RAM\n",$$b{text}+$$b{data},$$b{bss}); }' ! ! $(MAIN_SREC): $(MAIN_EXE) ! avr-objcopy --output-target=srec $(MAIN_EXE) $(MAIN_SREC) ! ! $(BUILDDIR): ! mkdir -p $(BUILDDIR) ! ! clean: ! rm -rf $(BUILDDIR) ! rm -f core.* ! rm -f *~ ! ! ! FORCE: ! ! .phony: FORCE |
From: <do...@us...> - 2003-11-04 23:04:18
|
Update of /cvsroot/firebug/mts400/sensors/sensirion In directory sc8-pr-cvs1:/tmp/cvs-serv12299/sensirion Log Message: Directory /cvsroot/firebug/mts400/sensors/sensirion added to the repository |
From: <do...@us...> - 2003-11-04 23:01:18
|
Update of /cvsroot/firebug/mts400/apps/TestIntersema In directory sc8-pr-cvs1:/tmp/cvs-serv11685/TestIntersema Log Message: Directory /cvsroot/firebug/mts400/apps/TestIntersema added to the repository |
From: <do...@us...> - 2003-11-04 23:01:18
|
Update of /cvsroot/firebug/mts400/apps/TestTaos In directory sc8-pr-cvs1:/tmp/cvs-serv11685/TestTaos Log Message: Directory /cvsroot/firebug/mts400/apps/TestTaos added to the repository |
From: <do...@us...> - 2003-11-04 23:01:17
|
Update of /cvsroot/firebug/mts400/apps/TestSensirion In directory sc8-pr-cvs1:/tmp/cvs-serv11685/TestSensirion Log Message: Directory /cvsroot/firebug/mts400/apps/TestSensirion added to the repository |
From: <do...@us...> - 2003-11-04 23:01:16
|
Update of /cvsroot/firebug/mts400/apps/TestGPS In directory sc8-pr-cvs1:/tmp/cvs-serv11685/TestGPS Log Message: Directory /cvsroot/firebug/mts400/apps/TestGPS added to the repository |
From: <do...@us...> - 2003-11-04 23:01:14
|
Update of /cvsroot/firebug/mts400/apps/TestADXL In directory sc8-pr-cvs1:/tmp/cvs-serv11685/TestADXL Log Message: Directory /cvsroot/firebug/mts400/apps/TestADXL added to the repository |
From: <do...@us...> - 2003-11-04 22:58:50
|
Update of /cvsroot/firebug/mts400/sensors In directory sc8-pr-cvs1:/tmp/cvs-serv11081/sensors Log Message: Directory /cvsroot/firebug/mts400/sensors added to the repository |