firebug-cvs Mailing List for FireBug: wireless wildfire monitoring (Page 22)
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) |
From: <do...@us...> - 2004-02-04 00:53:15
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22103 Modified Files: Makefile Removed Files: ADCError.nc HPLUARTC1.nc UART1.nc Log Message: Removed unnecessary serial port files. Index: Makefile =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 22 Jan 2004 00:40:07 -0000 1.1 --- Makefile 3 Feb 2004 19:38:49 -0000 1.2 *************** *** 1,2 **** clean: ! rm -rf *~ --- 1,2 ---- clean: ! rm -rf *~ *.bak --- ADCError.nc DELETED --- --- HPLUARTC1.nc DELETED --- --- UART1.nc DELETED --- |
From: <do...@us...> - 2004-02-04 00:04:33
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12533/sensors/leadtek9546 Modified Files: GpsPacket.nc GpsPacketM.nc gps_driver.nc gps_driverM.nc leadtek_9546.h Log Message: Moved some clean code in. Index: GpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/GpsPacket.nc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GpsPacket.nc 29 Jan 2004 14:48:04 -0000 1.4 --- GpsPacket.nc 3 Feb 2004 20:06:44 -0000 1.5 *************** *** 75,79 **** interface BareSendMsg as Send; interface ReceiveMsg as Receive; ! interface I2CSwitchCmds as GpsCmd; } } --- 75,79 ---- interface BareSendMsg as Send; interface ReceiveMsg as Receive; ! interface I2CSwitchCmds;// as GpsCmd; } } *************** *** 86,90 **** MicaWbSwitch; ! GpsCmd = GpsPacketM.GpsCmd; Control = GpsPacketM.Control; Send = GpsPacketM.Send; --- 86,91 ---- MicaWbSwitch; ! //GpsCmd = GpsPacketM.GpsCmd; ! I2CSwitchCmds = GpsPacketM; Control = GpsPacketM.Control; Send = GpsPacketM.Send; *************** *** 93,96 **** --- 94,100 ---- GpsPacketM.Leds -> LedsC; + // UART1 probably isn't strictly necessary, + // but it allows using local files instead + // of wiring to files in the tos tree. GpsPacketM.ByteControl -> UART1; GpsPacketM.ByteComm -> UART1; Index: GpsPacketM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/GpsPacketM.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GpsPacketM.nc 29 Jan 2004 14:48:04 -0000 1.1 --- GpsPacketM.nc 3 Feb 2004 20:06:44 -0000 1.2 *************** *** 90,94 **** interface ReceiveMsg as Receive; interface SendVarLenPacket; ! interface I2CSwitchCmds as GpsCmd; command result_t txBytes(uint8_t *bytes, uint8_t numBytes); --- 90,94 ---- interface ReceiveMsg as Receive; interface SendVarLenPacket; ! interface I2CSwitchCmds;// as GpsCmd; command result_t txBytes(uint8_t *bytes, uint8_t numBytes); *************** *** 115,121 **** implementation { ! enum {GPS_SWITCH_IDLE, //GPS I2C switches are not using the I2C bus GPS_PWR_SWITCH_WAIT, //Waiting for GPS I2C power switch to set ! GPS_EN_SWITCH_WAIT, //Waiting for GPS I2C enable switch to set GPS_TX_SWITCH_WAIT, //Waiting for GPS I2C tx switch to set GPS_RX_SWITCH_WAIT, //Waiting for GPS I2C rx switch to set --- 115,125 ---- implementation { ! #include "SODebug.h" ! #define DBG_USR2 1 ! ! ! enum {GPS_I2C_SWITCH_IDLE, //GPS I2C switches are not using the I2C bus GPS_PWR_SWITCH_WAIT, //Waiting for GPS I2C power switch to set ! GPS_I2C_ENABLE_SWITCH_WAIT, //Waiting for GPS I2C enable switch to set GPS_TX_SWITCH_WAIT, //Waiting for GPS I2C tx switch to set GPS_RX_SWITCH_WAIT, //Waiting for GPS I2C rx switch to set *************** *** 175,179 **** bufferIndex = 0; (GPS_Msg*) bufferPtr = &buffer; ! state_gps = GPS_SWITCH_IDLE; state_gps_pkt = NO_GPS_START_BYTE; state = IDLE; --- 179,183 ---- bufferIndex = 0; (GPS_Msg*) bufferPtr = &buffer; ! state_gps = GPS_I2C_SWITCH_IDLE; state_gps_pkt = NO_GPS_START_BYTE; state = IDLE; *************** *** 223,230 **** command result_t Send.send(TOS_MsgPtr msg) { ! GPS_Msg * gps_msg = (GPS_Msg*)msg; ! state = PACKET; //msg->crc = 1; /* Fake out the CRC as passed. */ //return call txBytes((uint8_t *)msg, TOS_MsgLength(msg->type)); //return call txBytes(msg->data, msg->length); --- 227,235 ---- command result_t Send.send(TOS_MsgPtr msg) { ! //GPS_Msg * gps_msg = (GPS_Msg*)msg; ! //state = PACKET; //msg->crc = 1; /* Fake out the CRC as passed. */ + state = PACKET; //return call txBytes((uint8_t *)msg, TOS_MsgLength(msg->type)); //return call txBytes(msg->data, msg->length); *************** *** 238,241 **** --- 243,247 ---- state = BYTES; + return call txBytes(packet, numBytes); } *************** *** 273,276 **** --- 279,283 ---- + void sendComplete(result_t success) { *************** *** 300,303 **** --- 307,311 ---- default event result_t SendVarLenPacket.sendDone(uint8_t* packet, result_t success) { + SODbg(DBG_USR2, "$GpsPacketM.SendVarLenPacket.sendDone(): success: %i\r\n", success); return success; } *************** *** 420,429 **** *****************************************************************************/ ! command result_t GpsCmd.PowerSwitch(uint8_t PowerState){ ! //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): PowerState: %i \n", PowerState); ! if (state_gps == GPS_SWITCH_IDLE){ power_gps = PowerState; --- 428,437 ---- *****************************************************************************/ ! //command result_t GpsCmd.PowerSwitch(uint8_t PowerState){ ! command result_t I2CSwitchCmds.PowerSwitch(uint8_t PowerState){ //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): PowerState: %i \n", PowerState); ! if (state_gps == GPS_I2C_SWITCH_IDLE){ power_gps = PowerState; *************** *** 447,450 **** --- 455,459 ---- + /** Power or Enabled switch set */ event result_t PowerSwitch.setDone(bool local_result) { *************** *** 452,458 **** 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; --- 461,467 ---- if (state_gps == GPS_PWR_SWITCH_WAIT) { if (call PowerSwitch.set(MICAWB_GPS_ENABLE ,power_gps) == SUCCESS) { ! state_gps = GPS_I2C_ENABLE_SWITCH_WAIT; } ! } else if (state_gps == GPS_I2C_ENABLE_SWITCH_WAIT) { if (call IOSwitch.set( MICAWB_GPS_TX_SELECT ,power_gps) == SUCCESS) { state_gps = GPS_TX_SWITCH_WAIT; *************** *** 476,482 **** } } else if (state_gps == GPS_RX_SWITCH_WAIT) { ! //GPSDbg(DBG_USR2, "GpsPacket.IOSwitch.setDone(): all switches set \n"); ! state_gps = GPS_SWITCH_IDLE; ! signal GpsCmd.SwitchesSet(state_gps); } --- 485,491 ---- } } else if (state_gps == GPS_RX_SWITCH_WAIT) { ! state_gps = GPS_I2C_SWITCH_IDLE; ! //signal GpsCmd.SwitchesSet(state_gps); ! signal I2CSwitchCmds.SwitchesSet(state_gps); } Index: gps_driver.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driver.nc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gps_driver.nc 29 Jan 2004 14:48:04 -0000 1.5 --- gps_driver.nc 3 Feb 2004 20:06:44 -0000 1.6 *************** *** 69,72 **** gps_driverM.GpsSend -> GpsPacket; gps_driverM.GpsReceive -> GpsPacket; ! gps_driverM.GpsCmd -> GpsPacket.GpsCmd; } --- 69,76 ---- gps_driverM.GpsSend -> GpsPacket; gps_driverM.GpsReceive -> GpsPacket; ! ! // FIXME: Remove the GpsCmd abstraction. In fact, ! // remove the I2CSwitchCmds interface completely. ! //gps_driverM.GpsCmd -> GpsPacket.GpsCmd; ! gps_driverM.I2CSwitchCmds -> GpsPacket.I2CSwitchCmds; } Index: gps_driverM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driverM.nc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gps_driverM.nc 28 Jan 2004 22:40:00 -0000 1.7 --- gps_driverM.nc 3 Feb 2004 20:06:44 -0000 1.8 *************** *** 56,60 **** interface StdControl as GpsControl; ! interface I2CSwitchCmds as GpsCmd; interface BareSendMsg as GpsSend; interface ReceiveMsg as GpsReceive; --- 56,60 ---- interface StdControl as GpsControl; ! interface I2CSwitchCmds; // as GpsCmd; interface BareSendMsg as GpsSend; interface ReceiveMsg as GpsReceive; *************** *** 125,129 **** /* Implementation is in GpsPacket.nc */ ! if (call GpsCmd.PowerSwitch(GPS_POWER_ON)) { SODbg(DBG_USR2, "gps_driverM.readGps(): GPS powered on\r\n"); gps_state = GPS_WORKING; --- 125,129 ---- /* Implementation is in GpsPacket.nc */ ! if (call I2CSwitchCmds.PowerSwitch(GPS_POWER_ON)) { SODbg(DBG_USR2, "gps_driverM.readGps(): GPS powered on\r\n"); gps_state = GPS_WORKING; *************** *** 246,261 **** GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! //signal Sensor.dataReady(gps_data); if ((call isGGA(gps_data->data))) { call parse_gga(gps_data); ! if (have_gps_fix) { //signal Sensor.dataReady(gps_data); call spew_to_uart(gps_data); signal Sensor.dataReady(&gga_msg); } ! } return data; --- 246,263 ---- GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! signal Sensor.dataReady(gps_data); + #if 0 if ((call isGGA(gps_data->data))) { call parse_gga(gps_data); ! //if (have_gps_fix) { //signal Sensor.dataReady(gps_data); call spew_to_uart(gps_data); signal Sensor.dataReady(&gga_msg); + //} } ! #endif return data; *************** *** 270,274 **** ! event result_t GpsCmd.SwitchesSet(uint8_t PowerState) { //SODbg(DBG_USR2, "gps_new.GpsCmd.SwitchesSet(): PowerState: %i \n\n", PowerState); --- 272,276 ---- ! event result_t I2CSwitchCmds.SwitchesSet(uint8_t PowerState) { //SODbg(DBG_USR2, "gps_new.GpsCmd.SwitchesSet(): PowerState: %i \n\n", PowerState); *************** *** 455,459 **** //call stopGps(); ! if (call GpsCmd.PowerSwitch(GPS_POWER_OFF)) { //SODbg(DBG_USR2,"gps_driverM.StdControl.stop(): GPS sensor powered off.\n"); --- 457,461 ---- //call stopGps(); ! if (call I2CSwitchCmds.PowerSwitch(GPS_POWER_OFF)) { //SODbg(DBG_USR2,"gps_driverM.StdControl.stop(): GPS sensor powered off.\n"); *************** *** 508,524 **** command result_t Sensor.loadProgram(uint8_t * program) { ! //TOS_MsgPtr msg = {0}; //strcpy(msg->data,program); ! GPS_Msg * msg; //msg->data = program; ! msg->length = strlen(program); ! program[0] = msg->length; ! strcpy(msg->data,program); signal Sensor.dataReady((void*)program); ! return call GpsSend.send(msg); } --- 510,526 ---- command result_t Sensor.loadProgram(uint8_t * program) { ! TOS_Msg msg = {0}; //strcpy(msg->data,program); ! //GPS_Msg msg; //msg->data = program; ! msg.length = strlen(program); ! //program[0] = msg.length; ! strcpy(msg.data,program); signal Sensor.dataReady((void*)program); ! return call GpsSend.send(&msg); } Index: leadtek_9546.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/leadtek_9546.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** leadtek_9546.h 28 Jan 2004 22:40:00 -0000 1.4 --- leadtek_9546.h 3 Feb 2004 20:06:44 -0000 1.5 *************** *** 102,105 **** --- 102,106 ---- #define NMEA_END2 "\n" //0x0A //ultimate byte of NMEA string + #define NMEA_GSV_MASK "0x0001" #define NMEA_GSA_MASK "0x0002" |
From: <do...@us...> - 2004-02-04 00:04:30
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12533/sensors/taos_tsl250rd Modified Files: TaosPhoto.nc TaosPhotoM.nc Log Message: Moved some clean code in. |
Update of /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12533/sensors/intersema5534ap Modified Files: IntersemaLower.nc IntersemaLowerM.nc IntersemaPressure.nc IntersemaPressureM.nc Removed Files: ADCError.nc Log Message: Moved some clean code in. Index: IntersemaPressure.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaPressure.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** IntersemaPressure.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- IntersemaPressure.nc 3 Feb 2004 20:06:44 -0000 1.2 *************** *** 95,100 **** IntersemaPressureM.LowerTemp -> IntersemaLower.Temp; ! IntersemaPressureM.LowerCalibrate -> IntersemaLower.Calibration; ! IntersemaPressureM.Timer -> TimerC.Timer[unique("Timer")]; IntersemaPressureM.TimerControl -> TimerC; } --- 95,100 ---- IntersemaPressureM.LowerTemp -> IntersemaLower.Temp; ! IntersemaPressureM.LowerCalibrate -> IntersemaLower.Calibration; ! IntersemaPressureM.Timer -> TimerC.Timer[unique("Timer")]; IntersemaPressureM.TimerControl -> TimerC; } --- ADCError.nc DELETED --- |
From: <do...@us...> - 2004-02-04 00:04:29
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12533/sensors/adxl202je Modified Files: adxlM.nc Log Message: Moved some clean code in. Index: adxlM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je/adxlM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** adxlM.nc 22 Jan 2004 00:40:06 -0000 1.2 --- adxlM.nc 3 Feb 2004 20:06:44 -0000 1.3 *************** *** 195,199 **** } ! default event result_t Sensor.error(uint16_t) { return SUCCESS; } --- 195,199 ---- } ! async default event result_t Sensor.error(uint16_t) { return SUCCESS; } |
From: <do...@pr...> - 2004-01-31 10:01:21
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22404 Modified Files: introduction.html Log Message: Added link Index: introduction.html =================================================================== RCS file: /cvsroot/firebug/firebug/web/introduction.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** introduction.html 20 Nov 2003 22:32:17 -0000 1.2 --- introduction.html 30 Jan 2004 18:39:16 -0000 1.3 *************** *** 18,21 **** --- 18,25 ---- <h1>Introduction</h1> + <p> + <b>New!</b>Professor Glaser's + <a href="sensor_net.pdf">talk</a> on sensor networks. + </p> <p> |
From: <do...@pr...> - 2004-01-31 09:41:03
|
Update of /cvsroot/firebug/firebug/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20228 Added Files: sensor_net.pdf Log Message: Added Steve's presentation. --- NEW FILE: sensor_net.pdf --- (This appears to be a binary file; contents omitted.) |
From: <do...@pr...> - 2004-01-31 03:28:52
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26542 Added Files: Makefile leadtek_9546.c Removed Files: HPLUART1M.nc HPLUARTC1.nc Log Message: c file for dealing with various aspects of checksums and programming strings added. Test code can be written against the code in this file. --- NEW FILE: Makefile --- clean: rm -rf *~ *.exe *.bak --- NEW FILE: leadtek_9546.c --- #include <stdio.h> #include <sys/types.h> #include <string.h> #include "leadtek_9546.h" unsigned char crc(char * data, int size) { unsigned char cs = 0; int i; //Omit $-character for (i=1; i<size; i++) { cs = cs ^((unsigned char)data[i]); } return cs; } int main(int argc, char ** argv) { char data[] = {"$LTC,1000,0"}; char data1[] = {"$GPGSV,3,3,11,03,19,314,21,29,19,044,39,02,15,293,24"}; char data2[] = {"$GPGGA,023129.762,3754.1755,N,12218.2682,W,1,08,1.1,-19.4,M,,,,0000"}; const uint8_t gps_gga_mask_crc[] = {"$LTC,NMEA," NMEA_GGA_MASK}; const uint8_t gps_rmc_mask_crc[] = {"$LTC,NMEA," NMEA_RMC_MASK}; const uint8_t gps_syncmode_on_crc[] = {"$LTC,SYNCMODE,1"}; const uint8_t gps_syncmode_off_crc[] = {"$LTC,SYNCMODE,0"}; const uint8_t gps_test_crc[] = {"$LTC,1552,1"}; printf("string: %s, crc: %x\n",data,crc(data,strlen(data))); printf("string: %s, crc: %x\n",data1,crc(data1,strlen(data1))); printf("string: %s, crc: %x\n",data2,crc(data2,strlen(data2))); printf("string: %s, crc: %x\n",gps_syncmode_off_crc,crc(gps_syncmode_off_crc,strlen(gps_syncmode_off_crc))); printf("string: %s, crc: %x\n",gps_test_crc,crc(gps_test_crc,strlen(gps_test_crc))); return 0; } // Will add these in later. #if 0 /** * This is an example for how to parse an NMEA GGA string. * It doubles as test code, and can be used in nesc with * minor changes. */ #include <stdio.h> static const unsigned char gga_string[] = ["$GPGGA,200831.748,3754.1771,N,12218.2665,W,1,06,1.2,-0.8,M,,,,0000*34"]; int main(int argc, char ** argv) { int i; unsigned char * p; return 0; } int main(int argc, char ** argv) { char nofix[] = {"$GPGGA,205121.168,,,,,9,23,,,M,,,,0000*3F"}; int num_commas,j; const char foo[] = {"df" "\n"}; printf("%s",foo); printf("%d\n",'0'-'0'); printf("%d\n",'1'-'0'); printf("%d\n",'2'-'0'); printf("%d\n",'3'-'0'); j = 0; num_commas = 0; while (num_commas < 6) { printf("%c",nofix[j]); if (nofix[j] == ',') { num_commas++; } j++; } printf("\n%c\n",nofix[j]); return 0; } #include <stdio.h> int main(int argc, char ** argv) { unsigned short foo = 13888; unsigned char bar[] = {"3754.1763"}; float dec_secs = 0; printf("cast foo to float: %f\n", (float)foo); dec_secs = 10*(bar[2]-'0') + (bar[3]-'0') + 0.1*(bar[5]-'0') + 0.01*(bar[6]-'0') + 0.001*(bar[7]-'0') + 0.0001*(bar[8]-'0'); printf("dec_secs: %f\n",dec_secs); // Write some test code for packing and // extracting NSEW /* 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; */ return 0; } #endif --- HPLUART1M.nc DELETED --- --- HPLUARTC1.nc DELETED --- |
From: <do...@pr...> - 2004-01-30 19:02:47
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21899 Modified Files: UART1.nc UARTGpsPacket.nc Log Message: Cleaning up the wiring. Index: UART1.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/UART1.nc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UART1.nc 21 Jan 2004 20:36:29 -0000 1.4 --- UART1.nc 29 Jan 2004 14:32:02 -0000 1.5 *************** *** 66,69 **** --- 66,70 ---- * Date last modified: 6/25/02 * + * Simplified wiring 01/28/04 David M. Doolin */ *************** *** 75,84 **** } implementation { ! components UARTM, HPLUARTC1; ! //components UARTM, HPLUARTC; ByteComm = UARTM; Control = UARTM; ! UARTM.HPLUART -> HPLUARTC1; ! //UARTM.HPLUART -> HPLUARTC; } --- 76,86 ---- } implementation { ! ! components UARTM, ! HPLUART1M; ByteComm = UARTM; Control = UARTM; ! ! UARTM.HPLUART -> HPLUART1M; } Index: UARTGpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/UARTGpsPacket.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** UARTGpsPacket.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- UARTGpsPacket.nc 29 Jan 2004 14:32:02 -0000 1.2 *************** *** 81,101 **** implementation { ! components GpsPacket as Packet, ! UART1 as UART, LedsC, MicaWbSwitch; ! GpsCmd = Packet.GpsCmd; ! Control = Packet.Control; ! Send = Packet.Send; ! Receive = Packet.Receive; ! Packet.Leds -> LedsC; ! Packet.ByteControl -> UART; ! Packet.ByteComm -> UART; ! Packet.SwitchControl -> MicaWbSwitch.StdControl; ! Packet.PowerSwitch -> MicaWbSwitch.Switch[0]; ! Packet.IOSwitch -> MicaWbSwitch.Switch[1]; } --- 81,102 ---- implementation { ! components GpsPacket, ! UART1, LedsC, MicaWbSwitch; ! GpsCmd = GpsPacket.GpsCmd; ! Control = GpsPacket.Control; ! Send = GpsPacket.Send; ! Receive = GpsPacket.Receive; ! GpsPacket.Leds -> LedsC; ! GpsPacket.ByteControl -> UART1; ! GpsPacket.ByteComm -> UART1; ! GpsPacket.SwitchControl -> MicaWbSwitch.StdControl; ! GpsPacket.PowerSwitch -> MicaWbSwitch.Switch[0]; ! GpsPacket.IOSwitch -> MicaWbSwitch.Switch[1]; } + |
From: <do...@pr...> - 2004-01-30 17:47:55
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25325 Modified Files: GpsPacket.nc gps_driver.nc Added Files: GpsPacketM.nc Removed Files: UARTGpsPacket.nc Log Message: Cleaned up wiring a lot. --- NEW FILE: GpsPacketM.nc --- /* -*- Mode: C; c-basic-indent: 3; indent-tabs-mode: nil -*- */ /** * "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: * Date last modified: 6/25/02 * */ /** * Parts of this code were written or modified for FireBug project * funded by the NSF Information Technology Research * initiative. Copyright Regents of the University of * of California, 2003. * * @url http://firebug.sourceforge.net * * @author David. M. Doolin */ /* This component handles the gps control and packet abstraction */ includes sensorboard; module GpsPacketM { provides { interface StdControl as Control; interface BareSendMsg as Send; interface ReceiveMsg as Receive; interface SendVarLenPacket; interface I2CSwitchCmds as GpsCmd; command result_t txBytes(uint8_t *bytes, uint8_t numBytes); /* Effects: start sending 'numBytes' bytes from 'bytes' */ // command result_t GpsPower(uint8_t PowerState); // /* 0 => gps power off; 1 => gps power on */ } uses { interface ByteComm; interface StdControl as ByteControl; interface Leds; interface StdControl as SwitchControl; interface Switch as PowerSwitch; interface Switch as IOSwitch; } } implementation { enum {GPS_SWITCH_IDLE, //GPS I2C switches are not using the I2C bus GPS_PWR_SWITCH_WAIT, //Waiting for GPS I2C power switch to set GPS_EN_SWITCH_WAIT, //Waiting for GPS I2C enable switch to set GPS_TX_SWITCH_WAIT, //Waiting for GPS I2C tx switch to set GPS_RX_SWITCH_WAIT, //Waiting for GPS I2C rx switch to set }; /** FIXME: Get rid of the norace specification. */ norace GPS_Msg buffer; //GPS_Msg* bufferPtr; norace TOS_MsgPtr bufferPtr; //really a GPS_Msg pointer norace uint8_t state_gps; //state of I2C switches norace uint8_t power_gps; //gps on off norace uint8_t state_gps_pkt; //detect gps pckt norace uint8_t bufferIndex; norace uint8_t *recPtr; norace uint8_t *sendPtr; 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. */ norace uint16_t rxCount; enum {IDLE, PACKET, BYTES, NO_GPS_START_BYTE = 0, GPS_START_BYTE = 1, GPS_BUF_NOT_AVAIL = 2 }; /* state == IDLE, nothing is being sent state == PACKET, this level is sending a packet state == BYTES, this level is just transferring bytes The purpose of adding the new state, to simply transfer bytes, is because certain applications may want to just send a sequence of bytes without the packet abstraction. One such example is the UART. */ /* Initialization of this component */ command result_t Control.init() { recPtr = (uint8_t *)&buffer; bufferIndex = 0; (GPS_Msg*) bufferPtr = &buffer; state_gps = GPS_SWITCH_IDLE; state_gps_pkt = NO_GPS_START_BYTE; state = IDLE; txCount = 0; rxCount = 0; rxLength = GPS_DATA_LENGTH; return call ByteControl.init(); } command result_t Control.start() { // apply your power management algorithm call SwitchControl.start(); return call ByteControl.start(); } /* Command to control the power of the network stack */ command result_t Control.stop() { // apply your power management algorithm return call ByteControl.stop(); } /** FIXME: Explain why we would want to transmit bytes, instead * of just reading bytes. */ command result_t txBytes(uint8_t *bytes, uint8_t numBytes) { if (txCount == 0) { txCount = 1; txLength = numBytes; sendPtr = bytes; /* send the first byte */ if (call ByteComm.txByte(sendPtr[0])) { return SUCCESS; } else { txCount = 0; } } return FAIL; } /* Command to transmit a packet */ command result_t Send.send(TOS_MsgPtr msg) { GPS_Msg * gps_msg = (GPS_Msg*)msg; state = PACKET; //msg->crc = 1; /* Fake out the CRC as passed. */ //return call txBytes((uint8_t *)msg, TOS_MsgLength(msg->type)); //return call txBytes(msg->data, msg->length); return call SendVarLenPacket.send(msg->data, msg->length); } /* 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; } /** * Signal gps buffer avail * Only one buffer */ task void receiveTask() { /** FIXME: tmp is unused. */ //TOS_Msg * tmp = signal Receive.receive(bufferPtr); state_gps_pkt = NO_GPS_START_BYTE; } /** * 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) { //GPSDbg(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) { rxCount = 0; return FAIL; } //if gps buffer not avail if (state_gps_pkt == GPS_BUF_NOT_AVAIL) { return SUCCESS; } if ((state_gps_pkt == NO_GPS_START_BYTE) && (data != GPS_PACKET_START)) { rxCount = 1; return SUCCESS; } else { state_gps_pkt = GPS_START_BYTE; } recPtr[rxCount++] = data; recPtr[0] = rxCount; /** Hopefully, rxCount won't ever exceed GPS_DATA_LENGTH */ if (rxCount == GPS_DATA_LENGTH ) { //GPSDbg(DBG_USR2, "gps packet too large- flushed \n"); state_gps_pkt = NO_GPS_START_BYTE; return SUCCESS; } if (data == GPS_PACKET_END2 ) { state_gps_pkt = GPS_BUF_NOT_AVAIL; rxCount = 1; post receiveTask(); return SUCCESS; } // bufferIndex = bufferIndex ^ 1; // recPtr = (uint8_t*)bufferPtr; ping pong buffers !!!!!!!!!!!!!!!!!! // GPSDbg(DBG_USR2, "got gps packet; # of bytes = %i \n", rxCount); // rxCount = 0; // post receiveTask(); // return FAIL; //} return SUCCESS; } /****************************************************************************** * Turn Gps on/off * PowerState = 0 then GPS power off, GPS enable off, tx and rx disabled * = 1 then GPS power on, GPS enable on, tx and rx enabled * NOTE - rx,tx share pressure lines. * - GPS switching power supply is enabled by a lo, disabled by a hi *****************************************************************************/ command result_t GpsCmd.PowerSwitch(uint8_t PowerState){ //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): PowerState: %i \n", PowerState); if (state_gps == GPS_SWITCH_IDLE){ power_gps = PowerState; if (power_gps){ /** Wired to MicaWBSwitch.set() */ if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): 2d arg 0\n"); } } else { if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { state_gps = GPS_PWR_SWITCH_WAIT; //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): 2d arg 1\n"); } } return SUCCESS; } return FAIL; } /** 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; } // 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; } } else if (state_gps == GPS_RX_SWITCH_WAIT) { //GPSDbg(DBG_USR2, "GpsPacket.IOSwitch.setDone(): all switches set \n"); state_gps = GPS_SWITCH_IDLE; signal GpsCmd.SwitchesSet(state_gps); } return SUCCESS; } 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: GpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/GpsPacket.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GpsPacket.nc 28 Jan 2004 22:39:59 -0000 1.3 --- GpsPacket.nc 29 Jan 2004 14:48:04 -0000 1.4 *************** *** 3,6 **** --- 3,8 ---- /** + * + * * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. *************** *** 23,27 **** * */ ! /* tab:4 * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to --- 25,29 ---- * */ ! /** * IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. By * downloading, copying, installing or using the software you agree to *************** *** 62,87 **** /* * ! * Authors: * Date last modified: 6/25/02 * */ ! /** ! * Parts of this code were written or modified for FireBug project ! * funded by the NSF Information Technology Research ! * initiative. Copyright Regents of the University of ! * of California, 2003. ! * ! * @url http://firebug.sourceforge.net ! * ! * @author David. M. Doolin ! */ ! ! ! /* This component handles the gps control and packet abstraction */ ! includes sensorboard; ! ! ! module GpsPacket { provides { --- 64,73 ---- /* * ! * Authors: Jason Hill, David Gay, Philip Levis * Date last modified: 6/25/02 * */ ! configuration GpsPacket { provides { *************** *** 89,499 **** interface BareSendMsg as Send; interface ReceiveMsg as Receive; - interface SendVarLenPacket; interface I2CSwitchCmds as GpsCmd; - - command result_t txBytes(uint8_t *bytes, uint8_t numBytes); - - /* Effects: start sending 'numBytes' bytes from 'bytes' */ - - // command result_t GpsPower(uint8_t PowerState); - // /* 0 => gps power off; 1 => gps power on */ - - } - uses { - interface ByteComm; - interface StdControl as ByteControl; - interface Leds; - - interface StdControl as SwitchControl; - interface Switch as PowerSwitch; - interface Switch as IOSwitch; - } } - implementation { ! enum {GPS_SWITCH_IDLE, //GPS I2C switches are not using the I2C bus ! GPS_PWR_SWITCH_WAIT, //Waiting for GPS I2C power switch to set ! GPS_EN_SWITCH_WAIT, //Waiting for GPS I2C enable switch to set ! GPS_TX_SWITCH_WAIT, //Waiting for GPS I2C tx switch to set ! GPS_RX_SWITCH_WAIT, //Waiting for GPS I2C rx switch to set ! }; ! ! /** FIXME: Get rid of the norace specification. */ ! norace GPS_Msg buffer; ! //GPS_Msg* bufferPtr; ! norace TOS_MsgPtr bufferPtr; //really a GPS_Msg pointer ! ! norace uint8_t state_gps; //state of I2C switches ! norace uint8_t power_gps; //gps on off ! norace uint8_t state_gps_pkt; //detect gps pckt ! norace uint8_t bufferIndex; ! norace uint8_t *recPtr; ! norace uint8_t *sendPtr; ! 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. ! */ ! norace uint16_t rxCount; ! ! ! enum {IDLE, ! PACKET, ! BYTES, ! NO_GPS_START_BYTE = 0, ! GPS_START_BYTE = 1, ! GPS_BUF_NOT_AVAIL = 2 ! }; ! ! ! ! /* ! state == IDLE, nothing is being sent ! state == PACKET, this level is sending a packet ! state == BYTES, this level is just transferring bytes ! ! The purpose of adding the new state, to simply transfer bytes, is because ! certain applications may want to just send a sequence of bytes without the ! packet abstraction. One such example is the UART. ! ! */ ! ! ! /* Initialization of this component */ ! ! command result_t Control.init() { ! ! recPtr = (uint8_t *)&buffer; ! bufferIndex = 0; ! (GPS_Msg*) bufferPtr = &buffer; ! state_gps = GPS_SWITCH_IDLE; ! state_gps_pkt = NO_GPS_START_BYTE; ! state = IDLE; ! txCount = 0; ! rxCount = 0; ! rxLength = GPS_DATA_LENGTH; ! return call ByteControl.init(); ! } ! ! ! command result_t Control.start() { ! ! // apply your power management algorithm ! call SwitchControl.start(); ! return call ByteControl.start(); ! } ! ! /* Command to control the power of the network stack */ ! command result_t Control.stop() { ! ! // apply your power management algorithm ! return call ByteControl.stop(); ! } ! ! /** FIXME: Explain why we would want to transmit bytes, instead ! * of just reading bytes. ! */ ! command result_t txBytes(uint8_t *bytes, uint8_t numBytes) { ! ! if (txCount == 0) { ! ! txCount = 1; ! txLength = numBytes; ! sendPtr = bytes; ! /* send the first byte */ ! if (call ByteComm.txByte(sendPtr[0])) { ! return SUCCESS; ! } else { ! txCount = 0; ! } ! } ! return FAIL; ! } ! ! ! /* Command to transmit a packet */ ! command result_t Send.send(TOS_MsgPtr msg) { ! ! GPS_Msg * gps_msg = (GPS_Msg*)msg; ! state = PACKET; ! //msg->crc = 1; /* Fake out the CRC as passed. */ ! ! //return call txBytes((uint8_t *)msg, TOS_MsgLength(msg->type)); ! //return call txBytes(msg->data, msg->length); ! return call SendVarLenPacket.send(msg->data, msg->length); ! } ! ! ! ! /* 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; ! } ! ! ! /** ! * Signal gps buffer avail ! * Only one buffer ! */ ! task void receiveTask() { ! ! /** FIXME: tmp is unused. */ ! //TOS_Msg * tmp = ! signal Receive.receive(bufferPtr); ! state_gps_pkt = NO_GPS_START_BYTE; ! } ! ! /** ! * 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) { ! ! //GPSDbg(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) { ! rxCount = 0; ! return FAIL; ! } ! ! //if gps buffer not avail ! if (state_gps_pkt == GPS_BUF_NOT_AVAIL) { ! return SUCCESS; ! } ! ! if ((state_gps_pkt == NO_GPS_START_BYTE) && (data != GPS_PACKET_START)) { ! rxCount = 1; ! return SUCCESS; ! } else { ! state_gps_pkt = GPS_START_BYTE; ! } ! ! recPtr[rxCount++] = data; ! recPtr[0] = rxCount; ! ! /** Hopefully, rxCount won't ever exceed GPS_DATA_LENGTH */ ! if (rxCount == GPS_DATA_LENGTH ) { ! ! //GPSDbg(DBG_USR2, "gps packet too large- flushed \n"); ! state_gps_pkt = NO_GPS_START_BYTE; ! return SUCCESS; ! } ! ! if (data == GPS_PACKET_END2 ) { ! state_gps_pkt = GPS_BUF_NOT_AVAIL; ! rxCount = 1; ! post receiveTask(); ! return SUCCESS; ! } ! ! // bufferIndex = bufferIndex ^ 1; ! // recPtr = (uint8_t*)bufferPtr; ping pong buffers !!!!!!!!!!!!!!!!!! ! // GPSDbg(DBG_USR2, "got gps packet; # of bytes = %i \n", rxCount); ! // rxCount = 0; ! // post receiveTask(); ! // return FAIL; ! //} ! ! return SUCCESS; ! } ! ! ! /****************************************************************************** ! * Turn Gps on/off ! * PowerState = 0 then GPS power off, GPS enable off, tx and rx disabled ! * = 1 then GPS power on, GPS enable on, tx and rx enabled ! * NOTE - rx,tx share pressure lines. ! * - GPS switching power supply is enabled by a lo, disabled by a hi ! *****************************************************************************/ ! ! command result_t GpsCmd.PowerSwitch(uint8_t PowerState){ ! ! ! //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): PowerState: %i \n", PowerState); ! ! if (state_gps == GPS_SWITCH_IDLE){ ! ! power_gps = PowerState; ! ! if (power_gps){ ! /** Wired to MicaWBSwitch.set() */ ! if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { ! state_gps = GPS_PWR_SWITCH_WAIT; ! //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): 2d arg 0\n"); ! } ! } else { ! if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { ! state_gps = GPS_PWR_SWITCH_WAIT; ! //GPSDbg(DBG_USR2, "GpsPacket.PowerSwitch.setDone(): 2d arg 1\n"); ! } ! } ! return SUCCESS; ! } ! return FAIL; ! } ! ! ! /** 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; ! } ! ! ! // 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; ! } ! } else if (state_gps == GPS_RX_SWITCH_WAIT) { ! //GPSDbg(DBG_USR2, "GpsPacket.IOSwitch.setDone(): all switches set \n"); ! state_gps = GPS_SWITCH_IDLE; ! signal GpsCmd.SwitchesSet(state_gps); ! } ! ! return SUCCESS; ! } ! 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; ! } } --- 75,102 ---- interface BareSendMsg as Send; interface ReceiveMsg as Receive; interface I2CSwitchCmds as GpsCmd; } } implementation { ! components GpsPacketM, ! UART1, ! LedsC, ! MicaWbSwitch; ! GpsCmd = GpsPacketM.GpsCmd; ! Control = GpsPacketM.Control; ! Send = GpsPacketM.Send; ! Receive = GpsPacketM.Receive; + GpsPacketM.Leds -> LedsC; ! GpsPacketM.ByteControl -> UART1; ! GpsPacketM.ByteComm -> UART1; ! GpsPacketM.SwitchControl -> MicaWbSwitch.StdControl; ! GpsPacketM.PowerSwitch -> MicaWbSwitch.Switch[0]; ! GpsPacketM.IOSwitch -> MicaWbSwitch.Switch[1]; } Index: gps_driver.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driver.nc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gps_driver.nc 14 Jan 2004 17:20:28 -0000 1.4 --- gps_driver.nc 29 Jan 2004 14:48:04 -0000 1.5 *************** *** 52,56 **** components gps_driverM, MicaWbSwitch, ! UARTGpsPacket, LedsC; --- 52,56 ---- components gps_driverM, MicaWbSwitch, ! GpsPacket, LedsC; *************** *** 66,72 **** gps_driverM.IOSwitch -> MicaWbSwitch.Switch[1]; ! gps_driverM.GpsControl -> UARTGpsPacket; ! gps_driverM.GpsSend -> UARTGpsPacket; ! gps_driverM.GpsReceive -> UARTGpsPacket; ! gps_driverM.GpsCmd -> UARTGpsPacket.GpsCmd; } --- 66,72 ---- gps_driverM.IOSwitch -> MicaWbSwitch.Switch[1]; ! gps_driverM.GpsControl -> GpsPacket; ! gps_driverM.GpsSend -> GpsPacket; ! gps_driverM.GpsReceive -> GpsPacket; ! gps_driverM.GpsCmd -> GpsPacket.GpsCmd; } --- UARTGpsPacket.nc DELETED --- |
From: <do...@pr...> - 2004-01-29 11:33:02
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestGPS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19299/apps/TestGPS Modified Files: testgpsM.nc Log Message: Fixed string extraction code for gga messages, It was attempting to stuff floats into shorts. Thats a nogo. Index: testgpsM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestGPS/testgpsM.nc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testgpsM.nc 21 Jan 2004 20:35:35 -0000 1.4 --- testgpsM.nc 28 Jan 2004 22:39:59 -0000 1.5 *************** *** 40,45 **** call LeadTek.powerOn(); // Loading programs doesn't work yet. ! //call LeadTek.loadProgram((void*)gps_syncmode_off); return SUCCESS; } --- 40,56 ---- call LeadTek.powerOn(); + // Loading programs doesn't work yet. ! //call LeadTek.loadProgram((void*)gps_test); ! call LeadTek.loadProgram((void*)gps_syncmode_off); ! ! #if 0 ! if (call LeadTek.loadProgram((void*)gps_test)) { ! SODbg(DBG_USR2, "Loading program succeeded in txBytes.\r\n"); ! } else { ! SODbg(DBG_USR2, "Loading program failed in txBytes.\r\n"); ! } ! #endif ! return SUCCESS; } *************** *** 57,64 **** --- 68,78 ---- } + + #define RAW_DATA 0 event result_t LeadTek.dataReady(void * userdata) { int i; + #if RAW_DATA GPS_Msg * gps_data = (GPS_Msg*)userdata; *************** *** 68,71 **** --- 82,101 ---- SODbg(DBG_USR2, "\r\n"); + #else + GGA_Msg * gga_msg = (GGA_Msg*)userdata; + + SODbg(DBG_USR2, "$=================================================\r\n"); + SODbg(DBG_USR2, "$testgpsM.LeadTek.dataReady()\r\n"); + SODbg(DBG_USR2, "$Hours: %i\r\n",(int)(gga_msg->hours)); + SODbg(DBG_USR2, "$Minutes: %i\r\n",(int)(gga_msg->minutes)); + SODbg(DBG_USR2, "$Decimal seconds: %i\r\n",(int)(100*(gga_msg->dec_sec))); + SODbg(DBG_USR2, "$Latitude degrees: %i\r\n",(int)(gga_msg->Lat_deg)); + SODbg(DBG_USR2, "$Latitude decimal minutes: %i\r\n",(int)(100*(gga_msg->Lat_dec_min))); + SODbg(DBG_USR2, "$Longitude degrees: %i\r\n",(int)(gga_msg->Long_deg)); + SODbg(DBG_USR2, "$Longitude decimal minutes: %i\r\n",(int)(100*(gga_msg->Long_dec_min))); + SODbg(DBG_USR2, "$NSEWind: %i\r\n",(gga_msg->NSEWind)); + SODbg(DBG_USR2, "$=================================================\r\n\r\n"); + #endif + call Leds.greenToggle(); |
From: <do...@pr...> - 2004-01-28 22:50:52
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19299/sensors/leadtek9546 Modified Files: GpsPacket.nc gps_driverM.nc leadtek_9546.h Log Message: Fixed string extraction code for gga messages, It was attempting to stuff floats into shorts. Thats a nogo. Index: GpsPacket.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/GpsPacket.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GpsPacket.nc 14 Jan 2004 17:20:28 -0000 1.2 --- GpsPacket.nc 28 Jan 2004 22:39:59 -0000 1.3 *************** *** 223,231 **** 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) { --- 223,237 ---- command result_t Send.send(TOS_MsgPtr msg) { + GPS_Msg * gps_msg = (GPS_Msg*)msg; state = PACKET; ! //msg->crc = 1; /* Fake out the CRC as passed. */ ! ! //return call txBytes((uint8_t *)msg, TOS_MsgLength(msg->type)); ! //return call txBytes(msg->data, msg->length); ! return call SendVarLenPacket.send(msg->data, msg->length); } + + /* Command to transfer a variable length packet */ command result_t SendVarLenPacket.send(uint8_t* packet, uint8_t numBytes) { *************** *** 491,492 **** --- 497,499 ---- } } + Index: gps_driverM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driverM.nc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gps_driverM.nc 21 Jan 2004 20:36:29 -0000 1.6 --- gps_driverM.nc 28 Jan 2004 22:40:00 -0000 1.7 *************** *** 26,34 **** command uint8_t extract_hours(char * data); command uint8_t extract_minutes(char * data); ! command uint16_t extract_dec_sec(char * data); command uint8_t extract_Lat_deg(char * data); ! command uint16_t extract_Lat_dec_min(char * data); command uint8_t extract_Long_deg(char * data); ! command uint16_t extract_Long_dec_min(char * data); command uint8_t extract_NSEWind(char * data); command uint8_t extract_num_sats(char * data); --- 26,34 ---- command uint8_t extract_hours(char * data); command uint8_t extract_minutes(char * data); ! command float extract_dec_sec(char * data); command uint8_t extract_Lat_deg(char * data); ! command float extract_Lat_dec_min(char * data); command uint8_t extract_Long_deg(char * data); ! command float extract_Long_dec_min(char * data); command uint8_t extract_NSEWind(char * data); command uint8_t extract_num_sats(char * data); *************** *** 36,40 **** command result_t isGGA(uint8_t * data); ! command result_t parse_gga(GPS_Msg * gps_data); command uint8_t get_gps_fix(char * data); --- 36,40 ---- command result_t isGGA(uint8_t * data); ! command result_t parse_gga(GPS_Msg * data); command uint8_t get_gps_fix(char * data); *************** *** 76,80 **** * to determine the values. */ ! norace uint8_t gps_fix = 0; enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, --- 76,80 ---- * to determine the values. */ ! norace bool have_gps_fix = 0; enum {IDLE, BUSY, BUSY_0, BUSY_1, GET_SAMPLE_0, GET_SAMPLE_1, *************** *** 187,190 **** --- 187,191 ---- command result_t log_gga_data_to_eeprom(GGA_Msg * pGGA) { + #if 0 int j; char gga_log_array[GPS_CHAR]; *************** *** 211,214 **** --- 212,216 ---- // Write into eeprom here. + #endif return SUCCESS; } *************** *** 218,221 **** --- 220,224 ---- int i; + SODbg(DBG_USR2, "\r\n"); for (i=0; i<=gps_data->length; i++) { /** UARTPutChar is an SODebug function. *************** *** 224,228 **** UARTPutChar(gps_data->data[i]); } ! //SODbg(DBG_USR2, "\r\n"); } --- 227,231 ---- UARTPutChar(gps_data->data[i]); } ! SODbg(DBG_USR2, "\r\n"); } *************** *** 243,260 **** GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! ! ! signal Sensor.dataReady(gps_data); ! /* if ((call isGGA(gps_data->data))) { ! //SODbg(DBG_USR2, "gps_driverM.GpsReceive.receive() GGA Data\r\n"); call parse_gga(gps_data); ! if (gps_fix) { ! signal Sensor.dataReady(gps_data); ! call Sensor.powerOff(); } } - */ return data; --- 246,261 ---- GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! //signal Sensor.dataReady(gps_data); ! if ((call isGGA(gps_data->data))) { ! call parse_gga(gps_data); ! if (have_gps_fix) { ! //signal Sensor.dataReady(gps_data); ! call spew_to_uart(gps_data); ! signal Sensor.dataReady(&gga_msg); } } return data; *************** *** 354,362 **** // Finding the gps fix should probably done somewhere else. ! gps_fix = call get_gps_fix(gga_fields[6]); //SODbg(DBG_USR2, "gps_new.parse_gga(): gps_fix %i \r\n", gps_fix); ! //call load_gga_struct(gga_fields); ! return SUCCESS; } --- 355,364 ---- // Finding the gps fix should probably done somewhere else. ! have_gps_fix = call get_gps_fix(gga_fields[6]); //SODbg(DBG_USR2, "gps_new.parse_gga(): gps_fix %i \r\n", gps_fix); ! if (have_gps_fix) { ! call load_gga_struct(gga_fields); ! } return SUCCESS; } *************** *** 373,384 **** /** FIXME: Where is data[6]? The decimal point? */ ! command uint16_t extract_dec_sec(char * data) { ! uint16_t dec_sec; ! dec_sec = 10000*(data[4]-'0') + 1000*(data[5]-'0') ! + 100*(data[7]-'0') + 10*(data[8]-'0') ! + (data[9]-'0'); ! return dec_sec; } --- 375,387 ---- /** FIXME: Where is data[6]? The decimal point? */ ! command float extract_dec_sec(char * data) { ! float dec_secs; ! dec_secs = 10*(data[4]-'0') + (data[5]-'0') + 0.1*(data[7]-'0') ! + 0.01*(data[8]-'0') ! + 0.001*(data[9]-'0'); ! ! return dec_secs; } *************** *** 387,396 **** } ! command uint16_t extract_Lat_dec_min(char * data) { ! uint16_t dec_min; dec_min = 100000*(data[2]-'0') + 10000*(data[3]-'0') + 1000*(data[4]-'0') + 100*(data[5]-'0') + 10*(data[6]-'0') + (data[7]-'0'); return dec_min; } --- 390,404 ---- } ! command float extract_Lat_dec_min(char * data) { ! float dec_min; ! dec_min = 10*(data[2]-'0') + (data[3]-'0') + 0.1*(data[5]-'0') ! + 0.01*(data[6]-'0') + 0.001*(data[7]-'0') + 0.0001*(data[8]-'0'); ! ! /* dec_min = 100000*(data[2]-'0') + 10000*(data[3]-'0') + 1000*(data[4]-'0') + 100*(data[5]-'0') + 10*(data[6]-'0') + (data[7]-'0'); + */ return dec_min; } *************** *** 401,410 **** } ! command uint16_t extract_Long_dec_min(char * data) { ! uint16_t dec_min; dec_min = 100000*(data[3]-'0') + 10000*(data[4]-'0') + 1000*(data[5]-'0') + 100*(data[6]-'0') + 10*(data[7]-'0') + (data[8]-'0'); return dec_min; } --- 409,424 ---- } ! command float extract_Long_dec_min(char * data) { ! float dec_min; ! ! dec_min = 10*(data[3]-'0') + (data[4]-'0') + 0.1*(data[6]-'0') ! + 0.01*(data[7]-'0') + 0.001*(data[8]-'0') + 0.0001*(data[9]-'0'); ! ! /* dec_min = 100000*(data[3]-'0') + 10000*(data[4]-'0') + 1000*(data[5]-'0') + 100*(data[6]-'0') + 10*(data[7]-'0') + (data[8]-'0'); + */ return dec_min; } *************** *** 446,450 **** gps_state = GPS_FINISHED; } ! gps_fix = 0; signal Sensor.powerOffDone(); return SUCCESS; --- 460,464 ---- gps_state = GPS_FINISHED; } ! have_gps_fix = 0; signal Sensor.powerOffDone(); return SUCCESS; *************** *** 494,504 **** command result_t Sensor.loadProgram(uint8_t * program) { ! TOS_MsgPtr msg = {0}; strcpy(msg->data,program); - signal Sensor.dataReady((void*)program); ! call GpsSend.send(msg); ! return SUCCESS; } --- 508,524 ---- command result_t Sensor.loadProgram(uint8_t * program) { ! //TOS_MsgPtr msg = {0}; ! //strcpy(msg->data,program); ! GPS_Msg * msg; ! //msg->data = program; ! ! msg->length = strlen(program); ! program[0] = msg->length; strcpy(msg->data,program); ! ! signal Sensor.dataReady((void*)program); ! return call GpsSend.send(msg); } Index: leadtek_9546.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/leadtek_9546.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** leadtek_9546.h 23 Jan 2004 01:08:26 -0000 1.3 --- leadtek_9546.h 28 Jan 2004 22:40:00 -0000 1.4 *************** *** 133,141 **** * FIXME: Find out what leadtek uses for a proprietary header string. */ ! //const uint8_t gps_gga_mask[] = {"$PLTC,NMEA," NMEA_GGA_MASK NMEA_END1 NMEA_END2}; ! //const uint8_t gps_rmc_mask[] = {"$PLTC,NMEA," NMEA_RMC_MASK NMEA_END1 NMEA_END2}; const uint8_t gps_syncmode_on[] = {"$LTC,SYNCMODE,1" NMEA_END1 NMEA_END2}; ! const uint8_t gps_syncmode_off[] = {"$LTC,SYNCMODE,0" NMEA_END1 NMEA_END2}; typedef struct _gga_msg GGA_Msg; --- 133,143 ---- * FIXME: Find out what leadtek uses for a proprietary header string. */ ! const uint8_t gps_gga_mask[] = {"$LTC,NMEA," NMEA_GGA_MASK NMEA_END1 NMEA_END2}; ! const uint8_t gps_rmc_mask[] = {"$LTC,NMEA," NMEA_RMC_MASK NMEA_END1 NMEA_END2}; const uint8_t gps_syncmode_on[] = {"$LTC,SYNCMODE,1" NMEA_END1 NMEA_END2}; ! const uint8_t gps_syncmode_off[] = {" ""$LTC,SYNCMODE,0*6F" NMEA_END1 NMEA_END2}; + const uint8_t gps_test[] = {" ""$LTC,1552,1*69" NMEA_END1 NMEA_END2}; + const uint8_t gps_test1[] = {" ""$LTC,1551,3,4*70" NMEA_END1 NMEA_END2}; typedef struct _gga_msg GGA_Msg; *************** *** 154,166 **** struct _gga_msg { uint8_t hours; uint8_t minutes; ! uint16_t dec_sec; uint8_t Lat_deg; ! uint16_t Lat_dec_min; uint8_t Long_deg; ! uint16_t Long_dec_min; uint8_t NSEWind; uint8_t num_sats; --- 156,170 ---- + + // 18 bytes. struct _gga_msg { uint8_t hours; uint8_t minutes; ! float dec_sec; uint8_t Lat_deg; ! float Lat_dec_min; uint8_t Long_deg; ! float Long_dec_min; uint8_t NSEWind; uint8_t num_sats; |
From: <do...@pr...> - 2004-01-28 22:48:31
|
Update of /cvsroot/firebug/fireboard/fireboard/sensorboards/xbow_mts420ca In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19299/sensorboards/xbow_mts420ca Modified Files: fireboardsensorM.nc Log Message: Fixed string extraction code for gga messages, It was attempting to stuff floats into shorts. Thats a nogo. Index: fireboardsensorM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensorboards/xbow_mts420ca/fireboardsensorM.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fireboardsensorM.nc 22 Jan 2004 00:40:06 -0000 1.2 --- fireboardsensorM.nc 28 Jan 2004 22:39:59 -0000 1.3 *************** *** 161,165 **** } ! event result_t SHT11.error(uint16_t error_code) {return SUCCESS;} event result_t SHT11.dataReady(void * userdata) { --- 161,165 ---- } ! async event result_t SHT11.error(uint16_t error_code) {return SUCCESS;} event result_t SHT11.dataReady(void * userdata) { *************** *** 198,202 **** } ! event result_t Intersema5534AP.error(uint16_t error_code) {return SUCCESS;} event result_t Intersema5534AP.dataReady(void * userdata) { --- 198,202 ---- } ! async event result_t Intersema5534AP.error(uint16_t error_code) {return SUCCESS;} event result_t Intersema5534AP.dataReady(void * userdata) { *************** *** 236,240 **** } ! event result_t LeadTek9546.error(uint16_t error_code) {return SUCCESS;} event result_t LeadTek9546.dataReady(void * userdata) { --- 236,240 ---- } ! async event result_t LeadTek9546.error(uint16_t error_code) {return SUCCESS;} event result_t LeadTek9546.dataReady(void * userdata) { *************** *** 254,257 **** --- 254,272 ---- //call Leds.greenToggle(); + // Use this if writing to serial port instead of leadtek + // monitor software. + #if 0 + SODbg(DBG_USR2, "=================================================\n"); + SODbg(DBG_USR2, "DataCollectM.GPS.dataReady()\n"); + SODbg(DBG_USR2, "Hours: %i\n",(int)(10*gga_msg->hours)); + SODbg(DBG_USR2, "Minutes: %i\n",(int)(10*gga_msg->minutes)); + SODbg(DBG_USR2, "Decimal seconds: %i\n",(int)(10*gga_msg->dec_sec)); + SODbg(DBG_USR2, "Latitude degrees: %i\n",(int)(10*gga_msg->Lat_deg)); + SODbg(DBG_USR2, "Latitude decimal minutes: %i\n",(int)(10*gga_msg->Lat_dec_min)); + SODbg(DBG_USR2, "Longitude degrees: %i\n",(int)(10*gga_msg->Long_deg)); + SODbg(DBG_USR2, "Longitude decimal minutes: %i\n",(int)(10*gga_msg->Long_dec_min)); + SODbg(DBG_USR2, "NSEWind: %i\n",(int)(10*gga_msg->NSEWind)); + SODbg(DBG_USR2, "=================================================\n"); + #endif //SODbg(DBG_USR2, "fireboardsensor.LeadTek.dataReady()\n"); *************** *** 276,280 **** } ! event result_t TAOS.error(uint16_t error_code) {return SUCCESS;} event result_t TAOS.dataReady(void * userdata) { --- 291,295 ---- } ! async event result_t TAOS.error(uint16_t error_code) {return SUCCESS;} event result_t TAOS.dataReady(void * userdata) { |
From: <do...@pr...> - 2004-01-23 01:22:21
|
Update of /cvsroot/firebug/firebug/doc/spie2004 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26122 Modified Files: spie_2004.tex Log Message: Added a way to annotate the spie document without munging it up dangerously. Index: spie_2004.tex =================================================================== RCS file: /cvsroot/firebug/firebug/doc/spie2004/spie_2004.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** spie_2004.tex 12 Jan 2004 04:08:02 -0000 1.8 --- spie_2004.tex 23 Jan 2004 01:21:30 -0000 1.9 *************** *** 1,3 **** ! \documentclass[]{spie} \input{comment} --- 1,3 ---- ! \documentclass[10pt]{spie} \input{comment} *************** *** 5,8 **** --- 5,9 ---- \usepackage{graphicx} \usepackage{chicago} + \usepackage{color} \usepackage{url} *************** *** 18,21 **** --- 19,32 ---- + %%% These can be used for annotations in the text. + \newcommand{\doolincomment}[1]{\textcolor{red}{#1}} + %% This one just throws away the argument. + %\newcommand{\doolincomment}[1]{} + + \newcommand{\sharmacomment}[1]{\textcolor{blue}{#1}} + %% This one just throws away the argument. + %\newcommand{\sharmacomment}[1]{} + + \title{Sensor network behavior at the urban-rural interface: making smart structures smarter} *************** *** 45,48 **** --- 56,62 ---- \section{Introduction} + + \doolincomment{The introduction looks pretty good.} + Smart structures incorporating wired and wireless network sensors are becoming closer to practical reality. Interpreting *************** *** 91,94 **** --- 105,111 ---- + \sharmacomment{We should be able to do some of this is + the next couple of weeks.} + Some of the questions that will need to be answered are: |
From: <do...@pr...> - 2004-01-23 01:09:11
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24537/leadtek9546 Modified Files: leadtek_9546.h Log Message: All of the sensor drivers appear to be working correctly. Index: leadtek_9546.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/leadtek_9546.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** leadtek_9546.h 15 Jan 2004 03:22:25 -0000 1.2 --- leadtek_9546.h 23 Jan 2004 01:08:26 -0000 1.3 *************** *** 78,83 **** ! #ifndef GPS_H ! #define GPS_H // The actual values for each of these may vary, --- 78,83 ---- ! #ifndef LEADTEK_9546_H ! #define LEADTEK_9546_H // The actual values for each of these may vary, *************** *** 102,116 **** #define NMEA_END2 "\n" //0x0A //ultimate byte of NMEA string ! #define NMEA_GSV_MASK 0x0001 ! #define NMEA_GSA_MASK 0x0002 ! #define NMEA_ZDA_MASK 0x0004 ! #define NMEA_PPS_MASK 0x0010 ! #define NMEA_FOM_MASK 0x0020 ! #define NMEA_GLL_MASK 0x1000 #define NMEA_GGA_MASK "0x2000" #define NMEA_VTG_MASK "0x4000" #define NMEA_RMC_MASK "0x8000" ! // This isn't used yet, but should be. #define GPS_POWER_OFF 0 #define GPS_POWER_ON 1 --- 102,125 ---- #define NMEA_END2 "\n" //0x0A //ultimate byte of NMEA string ! #define NMEA_GSV_MASK "0x0001" ! #define NMEA_GSA_MASK "0x0002" ! #define NMEA_ZDA_MASK "0x0004" ! #define NMEA_PPS_MASK "0x0010" ! #define NMEA_FOM_MASK "0x0020" ! #define NMEA_GLL_MASK "0x1000" #define NMEA_GGA_MASK "0x2000" #define NMEA_VTG_MASK "0x4000" #define NMEA_RMC_MASK "0x8000" ! ! /** ! * The leadtek has several different power states. ! * Each of these states should be documented here, ! * and a value defined to use when setting. These ! * values just control the switch. The power states ! * should be useful for setting the power and for ! * querying the driver code as to which power state ! * the unit is currently set at. ! */ #define GPS_POWER_OFF 0 #define GPS_POWER_ON 1 *************** *** 122,129 **** * Predefined "programs" useful for setting various states * of the GPS unit. These are all in NMEA format. */ //const uint8_t gps_gga_mask[] = {"$PLTC,NMEA," NMEA_GGA_MASK NMEA_END1 NMEA_END2}; //const uint8_t gps_rmc_mask[] = {"$PLTC,NMEA," NMEA_RMC_MASK NMEA_END1 NMEA_END2}; ! //const uint8_t gps_syncmode_on[] = {"$PLTC,SYNCMODE,1" NMEA_END1 NMEA_END2}; const uint8_t gps_syncmode_off[] = {"$LTC,SYNCMODE,0" NMEA_END1 NMEA_END2}; --- 131,139 ---- * Predefined "programs" useful for setting various states * of the GPS unit. These are all in NMEA format. + * FIXME: Find out what leadtek uses for a proprietary header string. */ //const uint8_t gps_gga_mask[] = {"$PLTC,NMEA," NMEA_GGA_MASK NMEA_END1 NMEA_END2}; //const uint8_t gps_rmc_mask[] = {"$PLTC,NMEA," NMEA_RMC_MASK NMEA_END1 NMEA_END2}; ! const uint8_t gps_syncmode_on[] = {"$LTC,SYNCMODE,1" NMEA_END1 NMEA_END2}; const uint8_t gps_syncmode_off[] = {"$LTC,SYNCMODE,0" NMEA_END1 NMEA_END2}; *************** *** 158,163 **** ! ! ! ! #endif --- 168,170 ---- ! #endif /* LEADTEK_9546_H */ |
From: <do...@pr...> - 2004-01-22 22:00:20
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27743 Modified Files: TaosPhotoM.nc taosM.nc Log Message: Sampling interval is now set and sampling started from the test application. Sampling intervals of 500 ms appear to be too fast for the device to respond, so default is set to 2000 ms, and the app was tested at 2500 and 4000 ms. Index: TaosPhotoM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/TaosPhotoM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TaosPhotoM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- TaosPhotoM.nc 22 Jan 2004 21:59:05 -0000 1.2 *************** *** 90,94 **** #include "SODebug.h" ! #define DBG_USR2 0 enum {IDLE, START_TAOS, SWITCH_POWER_ON, SWITCH_POWER_OFF, SWITCH_WAIT, --- 90,94 ---- #include "SODebug.h" ! #define DBG_USR2 0 enum {IDLE, START_TAOS, SWITCH_POWER_ON, SWITCH_POWER_OFF, SWITCH_WAIT, *************** *** 102,106 **** task void DataReady_0() { ! SODbg(DBG_USR2, "TaosPhoto:Ch0:, %i \n", (uint16_t)data_adc); signal ADC.dataReady[0](data_adc); return; --- 102,106 ---- task void DataReady_0() { ! SODbg(DBG_USR2, "TaosPhotoM.DataReady_0:, %i \r\n", (uint16_t)data_adc); signal ADC.dataReady[0](data_adc); return; *************** *** 108,112 **** task void DataReady_1(){ ! SODbg(DBG_USR2, "TaosPhoto:Ch1:, %i \n", (uint16_t)data_adc); signal ADC.dataReady[1](data_adc); return; --- 108,112 ---- task void DataReady_1(){ ! SODbg(DBG_USR2, "TaosPhotoM.DataReady_1:, %i \r\n", (uint16_t)data_adc); signal ADC.dataReady[1](data_adc); return; *************** *** 122,126 **** } ! SODbg(DBG_USR2, "TaosPhoto:init \n"); call I2CPacketControl.init(); --- 122,126 ---- } ! SODbg(DBG_USR2, "TaosPhotoM.SplitControl.init \r\n"); call I2CPacketControl.init(); *************** *** 138,142 **** command result_t SplitControl.start() { ! SODbg(DBG_USR2, "TaosPhoto:start \n"); atomic { --- 138,142 ---- command result_t SplitControl.start() { ! SODbg(DBG_USR2, "TaosPhotoM.SplitControl.start \r\n"); atomic { *************** *** 146,149 **** --- 146,150 ---- call SwitchControl.start(); if (call Switch.set(MICAWB_LIGHT_POWER,1) != SUCCESS) { + SODbg(DBG_USR2, "TaosPhotoM.SplitControl.start SWITCH_WAIT set\r\n"); state = SWITCH_WAIT; } *************** *** 217,221 **** async command result_t ADC.getData[uint8_t id]() { ! SODbg(DBG_USR2, "TaosPhoto:getData \n"); if (state == IDLE) { --- 218,222 ---- async command result_t ADC.getData[uint8_t id]() { ! SODbg(DBG_USR2, "TaosPhotoM.ADC.getData \r\n"); if (state == IDLE) { *************** *** 297,300 **** --- 298,302 ---- event result_t Timer.fired() { + SODbg(DBG_USR2, "TaosPhotoM.Timer.fired() \r\n"); atomic { state = IDLE; Index: taosM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/taosM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** taosM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- taosM.nc 22 Jan 2004 21:59:22 -0000 1.2 *************** *** 40,47 **** #define DBG_USR2 0 - enum {START, BUSY, LIGHT_DONE, ACCEL_DONE}; - uint16_t TaosData; ! uint8_t state; taos_tsl250rd_data_msg data_msg = {0}; --- 40,45 ---- #define DBG_USR2 0 uint16_t TaosData; ! uint16_t sampling_interval = 2000; taos_tsl250rd_data_msg data_msg = {0}; *************** *** 60,69 **** command result_t StdControl.start() { - - call Leds.redOn(); - call Leds.yellowOn(); - call Leds.greenOn(); - state = START; - //call Timer.start(TIMER_REPEAT, 500); return SUCCESS; } --- 58,61 ---- *************** *** 75,98 **** event result_t Timer.fired() { ! call Leds.redOff(); ! call Leds.yellowOff(); ! call Leds.greenOff(); ! ! switch (state) { ! ! case START: ! state = BUSY; ! call TaosControl.start(); ! break; ! ! case LIGHT_DONE: ! state = START; ! break; ! ! default: ! break; ! } ! ! return SUCCESS; } --- 67,72 ---- event result_t Timer.fired() { ! SODbg(DBG_USR2, "taosM.Timer.fired() \r\n") ; ! call TaosControl.start(); return SUCCESS; } *************** *** 202,206 **** event result_t TaosControl.stopDone() { - state = LIGHT_DONE; signal Sensor.powerOffDone(); return SUCCESS; --- 176,179 ---- *************** *** 233,237 **** } ! command result_t Sensor.setSamplingInterval(uint16_t sampling_rate) { return SUCCESS; } --- 206,214 ---- } ! command result_t Sensor.setSamplingInterval(uint16_t interval) { ! ! atomic { ! sampling_interval = interval; ! } return SUCCESS; } *************** *** 242,245 **** --- 219,224 ---- command result_t Sensor.startSampling() { + SODbg(DBG_USR2, "taosM.Sensor.startSampling() \r\n") ; + call Timer.start(TIMER_REPEAT, sampling_interval); return SUCCESS; } *************** *** 257,261 **** } ! default event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } --- 236,240 ---- } ! default async event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } |
From: <do...@pr...> - 2004-01-22 21:54:31
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestTaos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26632 Modified Files: testtaosM.nc Log Message: Sampling interval is now set and sampling started from the test application. Sampling intervals of 500 ms appear to be too fast for the device to respond, so default is set to 2000 ms, and the app was tested at 2500 and 4000 ms. Index: testtaosM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestTaos/testtaosM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testtaosM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- testtaosM.nc 22 Jan 2004 21:53:40 -0000 1.2 *************** *** 30,34 **** command result_t StdControl.init() { - init_debug(); call Leds.init(); --- 30,33 ---- *************** *** 37,41 **** command result_t StdControl.start() { ! call TAOS.powerOn(); return SUCCESS; } --- 36,42 ---- command result_t StdControl.start() { ! ! call TAOS.setSamplingInterval(2500); ! call TAOS.startSampling(); return SUCCESS; } *************** *** 73,77 **** call Leds.greenToggle(); ! SODbg(DBG_USR2, "Taos Ch%i data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \n", channel, taos_data,cord,step,adc,(int)lux); --- 74,78 ---- call Leds.greenToggle(); ! SODbg(DBG_USR2, "Taos Ch%i data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \r\n", channel, taos_data,cord,step,adc,(int)lux); *************** *** 80,86 **** ! event result_t TAOS.error(uint16_t error_code) { ! SODbg(DBG_USR2, "OVERFLOW\n"); return SUCCESS; } --- 81,87 ---- ! async event result_t TAOS.error(uint16_t error_code) { ! SODbg(DBG_USR2, "OVERFLOW\r\n"); return SUCCESS; } |
From: <do...@us...> - 2004-01-22 00:40:10
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/sensors/taos_tsl250rd Modified Files: TaosPhotoM.nc taos.nc taosM.nc Added Files: Makefile Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. --- NEW FILE: Makefile --- clean: rm -rf *~ Index: TaosPhotoM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/TaosPhotoM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TaosPhotoM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- TaosPhotoM.nc 22 Jan 2004 00:40:07 -0000 1.2 *************** *** 90,94 **** #include "SODebug.h" ! #define DBG_USR2 0 enum {IDLE, START_TAOS, SWITCH_POWER_ON, SWITCH_POWER_OFF, SWITCH_WAIT, --- 90,94 ---- #include "SODebug.h" ! #define DBG_USR2 1 enum {IDLE, START_TAOS, SWITCH_POWER_ON, SWITCH_POWER_OFF, SWITCH_WAIT, *************** *** 138,142 **** command result_t SplitControl.start() { ! SODbg(DBG_USR2, "TaosPhoto:start \n"); atomic { --- 138,142 ---- command result_t SplitControl.start() { ! SODbg(DBG_USR2, "TaosPhotoM.SplitControl.start \r\n"); atomic { *************** *** 146,149 **** --- 146,150 ---- call SwitchControl.start(); if (call Switch.set(MICAWB_LIGHT_POWER,1) != SUCCESS) { + SODbg(DBG_USR2, "TaosPhotoM.SplitControl.start SWITCH_WAIT set\r\n"); state = SWITCH_WAIT; } Index: taos.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/taos.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** taos.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- taos.nc 22 Jan 2004 00:40:07 -0000 1.2 *************** *** 24,28 **** components taosM, ! MicaWbSwitch, TimerC, NoLeds, --- 24,28 ---- components taosM, ! //MicaWbSwitch, TimerC, NoLeds, Index: taosM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/taos_tsl250rd/taosM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** taosM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- taosM.nc 22 Jan 2004 00:40:07 -0000 1.2 *************** *** 38,47 **** #include "taos_tsl250rd.h" #include "SODebug.h" ! #define DBG_USR2 0 ! ! enum {START, BUSY, LIGHT_DONE, ACCEL_DONE}; uint16_t TaosData; - uint8_t state; taos_tsl250rd_data_msg data_msg = {0}; --- 38,44 ---- #include "taos_tsl250rd.h" #include "SODebug.h" ! #define DBG_USR2 1 uint16_t TaosData; taos_tsl250rd_data_msg data_msg = {0}; *************** *** 60,69 **** command result_t StdControl.start() { - - call Leds.redOn(); - call Leds.yellowOn(); - call Leds.greenOn(); - state = START; - //call Timer.start(TIMER_REPEAT, 500); return SUCCESS; } --- 57,60 ---- *************** *** 75,98 **** event result_t Timer.fired() { ! call Leds.redOff(); ! call Leds.yellowOff(); ! call Leds.greenOff(); ! ! switch (state) { ! ! case START: ! state = BUSY; ! call TaosControl.start(); ! break; ! ! case LIGHT_DONE: ! state = START; ! break; ! ! default: ! break; ! } ! ! return SUCCESS; } --- 66,71 ---- event result_t Timer.fired() { ! SODbg(DBG_USR2, "taosM.Timer.fired() \r\n") ; ! call TaosControl.start(); return SUCCESS; } *************** *** 202,206 **** event result_t TaosControl.stopDone() { - state = LIGHT_DONE; signal Sensor.powerOffDone(); return SUCCESS; --- 175,178 ---- *************** *** 242,245 **** --- 214,219 ---- command result_t Sensor.startSampling() { + SODbg(DBG_USR2, "taosM.Sensor.startSampling() \r\n") ; + call Timer.start(TIMER_REPEAT, 500); return SUCCESS; } *************** *** 257,261 **** } ! default event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } --- 231,235 ---- } ! default async event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } |
From: <do...@us...> - 2004-01-22 00:40:10
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/sensors/intersema5534ap Modified Files: Intersema.nc IntersemaLower.nc IntersemaM.nc Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. Index: Intersema.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/Intersema.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Intersema.nc 6 Jan 2004 16:29:47 -0000 1.2 --- Intersema.nc 22 Jan 2004 00:40:06 -0000 1.3 *************** *** 76,81 **** implementation { ! components IntersemaM, IntersemaPressure, ! MicaWbSwitch, TimerC, NoLeds,LedsC; IntersemaM.StdControl = StdControl; --- 76,85 ---- implementation { ! ! components IntersemaM, ! IntersemaPressure, ! TimerC, ! NoLeds, ! LedsC; IntersemaM.StdControl = StdControl; Index: IntersemaLower.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaLower.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** IntersemaLower.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- IntersemaLower.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 1,6 **** /* tab:4 ! * ! * ! * "Copyright (c) 2000-2002 The Regents of the University of California. * All rights reserved. * --- 1,4 ---- /* tab:4 ! * "Copyright (c) 2000-2003 The Regents of the University of California. * All rights reserved. * *************** *** 21,61 **** * 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. - * * */ /* --- 19,29 ---- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * ! * Copyright (c) 2002-2003 Intel Corporation * All rights reserved. * + * This file is distributed under the terms in the attached INTEL-LICENSE + * file. If you do not find these files, copies can be found by writing to + * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, + * 94704. Attention: Intel License Inquiry. */ /* Index: IntersemaM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/intersema5534ap/IntersemaM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** IntersemaM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- IntersemaM.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 87,95 **** command result_t StdControl.start() { - call Leds.redOn(); - call Leds.yellowOn(); - call Leds.greenOn(); state = START; - //call Timer.start(TIMER_REPEAT, 1500); return SUCCESS; } --- 87,91 ---- *************** *** 105,112 **** event result_t Timer.fired() { - call Leds.redOff(); - call Leds.yellowOff(); - call Leds.greenOff(); - call PressureControl.start(); return SUCCESS; --- 101,104 ---- *************** *** 154,158 **** data,PressureData,(int)Temp, (int)Press); - //signal Sensor.dataReady((void*)0); // FIXME: PressureControl is wired to SplitControl in IntersemaPressureM, --- 146,149 ---- *************** *** 247,250 **** --- 238,242 ---- command result_t Sensor.startSampling() { + call Timer.start(TIMER_REPEAT, 1500); return SUCCESS; } *************** *** 266,270 **** } ! default event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } --- 258,262 ---- } ! async default event result_t Sensor.error(uint16_t error_code) { return SUCCESS; } |
From: <do...@us...> - 2004-01-22 00:40:10
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/sensirion_sht11 In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/sensors/sensirion_sht11 Added Files: Makefile Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. --- NEW FILE: Makefile --- clean: rm -rf *~ |
From: <do...@us...> - 2004-01-22 00:40:10
|
Update of /cvsroot/firebug/fireboard/fireboard/sensorboards/xbow_mts420ca In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/sensorboards/xbow_mts420ca Modified Files: fireboardsensor.nc fireboardsensorM.nc Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. Index: fireboardsensor.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensorboards/xbow_mts420ca/fireboardsensor.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** fireboardsensor.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- fireboardsensor.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 12,16 **** includes sensorboard; includes fireboard; ! includes gps; configuration fireboardsensor { --- 12,17 ---- includes sensorboard; includes fireboard; ! includes leadtek_9546; ! includes sensirion_sht11; configuration fireboardsensor { Index: fireboardsensorM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensorboards/xbow_mts420ca/fireboardsensorM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** fireboardsensorM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- fireboardsensorM.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 31,35 **** uses { - interface Leds; --- 31,34 ---- *************** *** 65,82 **** Firedata_msg firemsg = {0}; ! ! GGA_Msg gga_msg; char state1; - uint16_t TaosData; - - uint16_t calibration[6]; - uint16_t C1,C2,C3,C4,C5,C6; - uint16_t PressureData; - - uint16_t HumData; - - enum {IDLE, BUSY, GPS_DONE, SHT_DONE, --- 64,71 ---- Firedata_msg firemsg = {0}; ! GGA_Msg gga_msg = {0}; char state1; enum {IDLE, BUSY, GPS_DONE, SHT_DONE, *************** *** 84,89 **** - - default event result_t Data.dataReady[uint8_t id](void * msg) { return SUCCESS; --- 73,76 ---- *************** *** 94,98 **** state1 = IDLE; init_debug(); ! call Leds.init(); return SUCCESS; } --- 81,85 ---- state1 = IDLE; init_debug(); ! //call Leds.init(); return SUCCESS; } *************** *** 100,106 **** command result_t StdControl.start() { ! call Leds.redOn(); call GlobalTimer.start(TIMER_REPEAT, 3000) ; ! SODbg(DBG_USR2, "fireboardsensorM.StdControl.start()\n"); return SUCCESS; } --- 87,93 ---- command result_t StdControl.start() { ! //call Leds.redOn(); call GlobalTimer.start(TIMER_REPEAT, 3000) ; ! //SODbg(DBG_USR2, "fireboardsensorM.StdControl.start()\n"); return SUCCESS; } *************** *** 115,119 **** event result_t GlobalTimer.fired() { ! SODbg(DBG_USR2, "fireboardsensorM.GlobalTimer.fired()\n"); switch (state1) { --- 102,107 ---- event result_t GlobalTimer.fired() { ! //SODbg(DBG_USR2, "fireboardsensorM.GlobalTimer.fired()\n"); ! switch (state1) { *************** *** 125,129 **** state1 = BUSY; call LeadTek9546.powerOn(); ! signal Data.dataReady[0]((void*)(&gga_msg)); break; --- 113,119 ---- state1 = BUSY; call LeadTek9546.powerOn(); ! if (signal Data.dataReady[0]((void*)(&gga_msg))) { ! state1 = GPS_DONE; ! } break; *************** *** 145,150 **** case LIGHT_DONE: state1 = BUSY; ! signal Data.dataReady[1](&firemsg); ! state1 = IDLE; break; --- 135,141 ---- case LIGHT_DONE: state1 = BUSY; ! if (signal Data.dataReady[1](&firemsg)) { ! state1 = IDLE; ! } break; *************** *** 165,169 **** event result_t SHT11.powerOffDone() { ! SODbg(DBG_USR2, "fireboardsensorM.SHT11.stopDone()\n") state1 = SHT_DONE; return SUCCESS; --- 156,160 ---- event result_t SHT11.powerOffDone() { ! //SODbg(DBG_USR2, "fireboardsensorM.SHT11.stopDone()\n") state1 = SHT_DONE; return SUCCESS; *************** *** 186,190 **** //call Leds.greenToggle(); ! SODbg(DBG_USR2, "SHT11.dataReady: Humidity: Temp(adc): %i Humidity(adc): %i Temp(degCx10): %i Humidity(%): %i \n",tempdata,rel_humdata,(int)temp, (int)rel_hum); atomic { --- 177,181 ---- //call Leds.greenToggle(); ! SODbg(DBG_USR2, "SHT11.dataReady: Humidity: Temp(adc): %i Humidity(adc): %i Temp(degCx10): %i Humidity(%): %i \r\n",tempdata,rel_humdata,(int)temp, (int)rel_hum); atomic { *************** *** 224,228 **** baro_pres = msg->baro_pres; ! SODbg(DBG_USR2, "Pressure: Temp(adc): %i Press(adc): %i Temp(degCx10): %i Press(mbar): %i \n", tempdata,baro_presdata,(int)temp, (int)baro_pres); #endif --- 215,219 ---- baro_pres = msg->baro_pres; ! SODbg(DBG_USR2, "Pressure: Temp(adc): %i Press(adc): %i Temp(degCx10): %i Press(mbar): %i \r\n", tempdata,baro_presdata,(int)temp, (int)baro_pres); #endif *************** *** 241,245 **** event result_t LeadTek9546.powerOffDone() { ! state1 = GPS_DONE; return SUCCESS; } --- 232,236 ---- event result_t LeadTek9546.powerOffDone() { ! //state1 = GPS_DONE; return SUCCESS; } *************** *** 252,255 **** --- 243,248 ---- GPS_Msg * gps_data = (GPS_Msg*)userdata; + + SODbg(DBG_USR2, "\r\n"); for (i=0; i<=gps_data->data[0]; i++) { /** UARTPutChar is an SODebug function. *************** *** 258,266 **** UARTPutChar(gps_data->data[i]); } ! SODbg(DBG_USR2, "\n"); ! call Leds.greenToggle(); ! SODbg(DBG_USR2, "fireboardsensor.LeadTek.dataReady()\n"); atomic { call LeadTek9546.powerOff(); --- 251,259 ---- UARTPutChar(gps_data->data[i]); } ! SODbg(DBG_USR2, "\r\n"); ! //call Leds.greenToggle(); ! //SODbg(DBG_USR2, "fireboardsensor.LeadTek.dataReady()\n"); atomic { call LeadTek9546.powerOff(); *************** *** 271,274 **** --- 264,268 ---- + /** Taos TSL250RD light intensity sensor events. */ *************** *** 277,281 **** event result_t TAOS.powerOffDone() { ! SODbg(DBG_USR2, "fireboardsensor.TAOS.powerOffDone()\n"); state1 = LIGHT_DONE; return SUCCESS; --- 271,275 ---- event result_t TAOS.powerOffDone() { ! //SODbg(DBG_USR2, "fireboardsensor.TAOS.powerOffDone()\n"); state1 = LIGHT_DONE; return SUCCESS; *************** *** 287,290 **** --- 281,285 ---- taos_tsl250rd_data_msg * data_msg = (taos_tsl250rd_data_msg*)userdata; + float lux = 0; #if DBG_USR2 *************** *** 294,298 **** uint16_t step; uint16_t adc; ! float lux; channel = data_msg->channel; --- 289,293 ---- uint16_t step; uint16_t adc; ! channel = data_msg->channel; *************** *** 305,309 **** //call Leds.greenToggle(); ! SODbg(DBG_USR2, "Taos Ch%i data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \n", channel, taos_data,cord,step,adc,(int)lux); #endif --- 300,304 ---- //call Leds.greenToggle(); ! SODbg(DBG_USR2, "Taos Ch%i data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \r\n", channel, taos_data,cord,step,adc,(int)lux); #endif |
From: <do...@us...> - 2004-01-22 00:40:09
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/sensors/adxl202je Modified Files: adxlM.nc Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. Index: adxlM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/adxl202je/adxlM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** adxlM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- adxlM.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 53,56 **** --- 53,58 ---- #include "adxl202je.h" #include "SODebug.h" + #define DBG_USR2 0 + #define ACCEL_POWER_OFF 0 #define ACCEL_POWER_ON 1 *************** *** 65,69 **** command result_t StdControl.init() { ! init_debug(); call Leds.init(); --- 67,71 ---- command result_t StdControl.init() { ! //init_debug(); call Leds.init(); *************** *** 74,81 **** command result_t StdControl.start() { ! call Leds.redOn(); ! call Leds.yellowOn(); ! call Leds.greenOn(); ! call Timer.start(TIMER_REPEAT, 500); return SUCCESS; } --- 76,80 ---- command result_t StdControl.start() { ! //call Timer.start(TIMER_REPEAT, 500); return SUCCESS; } *************** *** 88,95 **** event result_t Timer.fired() { - call Leds.redOff(); - call Leds.yellowOff(); - call Leds.greenOff(); - call AccelCmd.PowerSwitch(ACCEL_POWER_ON); return SUCCESS; --- 87,90 ---- *************** *** 151,155 **** event result_t AccelCmd.SwitchesSet(uint8_t PowerState) { - call Leds.greenToggle(); if (PowerState) { call AccelX.getData(); --- 146,149 ---- |
From: <do...@us...> - 2004-01-22 00:40:09
|
Update of /cvsroot/firebug/fireboard/fireboard/interfaces In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/interfaces Modified Files: Sensor.nc Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. Index: Sensor.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/interfaces/Sensor.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Sensor.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- Sensor.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 137,140 **** * the sensor header file. */ ! event result_t error(uint16_t error_code); } --- 137,140 ---- * the sensor header file. */ ! async event result_t error(uint16_t error_code); } |
From: <do...@us...> - 2004-01-22 00:40:09
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestTaos In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/apps/TestTaos Modified Files: testtaosM.nc Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. Index: testtaosM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestTaos/testtaosM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testtaosM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- testtaosM.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 37,41 **** command result_t StdControl.start() { ! call TAOS.powerOn(); return SUCCESS; } --- 37,41 ---- command result_t StdControl.start() { ! call TAOS.startSampling(); return SUCCESS; } *************** *** 73,77 **** call Leds.greenToggle(); ! SODbg(DBG_USR2, "Taos Ch%i data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \n", channel, taos_data,cord,step,adc,(int)lux); --- 73,77 ---- call Leds.greenToggle(); ! SODbg(DBG_USR2, "Taos Ch%i data: %i Cord: %i Step: %i ADC Counts: %i Light(lux): %i \r\n", channel, taos_data,cord,step,adc,(int)lux); *************** *** 80,86 **** ! event result_t TAOS.error(uint16_t error_code) { ! SODbg(DBG_USR2, "OVERFLOW\n"); return SUCCESS; } --- 80,86 ---- ! async event result_t TAOS.error(uint16_t error_code) { ! SODbg(DBG_USR2, "OVERFLOW\r\n"); return SUCCESS; } |
From: <do...@us...> - 2004-01-22 00:40:09
|
Update of /cvsroot/firebug/fireboard/fireboard/apps/TestIntersema In directory sc8-pr-cvs1:/tmp/cvs-serv31002/fireboard/apps/TestIntersema Modified Files: testintersemaM.nc Log Message: Crash bang boom. Light and barometer are down at the moment, but the driver code is getting much cleaner. May need to back out a couple of minor changes later. There may be a file or two that have been removed from the archive that will be actually needed, it/they can be added back if it is not possible to make the system files work. Index: testintersemaM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/apps/TestIntersema/testintersemaM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** testintersemaM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- testintersemaM.nc 22 Jan 2004 00:40:06 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- command result_t StdControl.start() { + call Intersema5534AP.startSampling(); return SUCCESS; } *************** *** 66,75 **** call Leds.greenToggle(); ! SODbg(DBG_USR2, "Pressure: Temp(adc): %i Press(adc): %i Temp(degCx10): %i Press(mbar): %i \n", tempdata,baro_presdata,(int)temp, (int)baro_pres); return SUCCESS; } ! event result_t Intersema5534AP.error(uint16_t error_code) { return SUCCESS; } --- 67,76 ---- call Leds.greenToggle(); ! SODbg(DBG_USR2, "Pressure: Temp(adc): %i Press(adc): %i Temp(degCx10): %i Press(mbar): %i \r\n", tempdata,baro_presdata,(int)temp, (int)baro_pres); return SUCCESS; } ! async event result_t Intersema5534AP.error(uint16_t error_code) { return SUCCESS; } |