[Firebug-cvs] fireboard/fireboard/sensors/leadtek9546 gps.h,1.1.1.1,1.2 gps_driver.nc,1.2,1.3 gps_dr
Brought to you by:
doolin
From: <do...@us...> - 2004-01-14 14:05:37
|
Update of /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546 In directory sc8-pr-cvs1:/tmp/cvs-serv3689 Modified Files: gps.h gps_driver.nc gps_driverM.nc Removed Files: sensorboard.h Log Message: Cleaning up gps code. Removed some dead code, Index: gps.h =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gps.h 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- gps.h 14 Jan 2004 14:05:34 -0000 1.2 *************** *** 81,84 **** --- 81,87 ---- #define GPS_H + // The actual values for each of these may vary, + // especially characters per field, which may be + // application dependent. #define GPS_MSG_LENGTH 100 #define GPS_CHAR 11 *************** *** 90,96 **** #define GPS_DATA_LENGTH 128 ! #define GPS_PACKET_START 0x24 //start of gps packet ! #define GPS_PACKET_END1 0x0D //penultimate byte of gps packet ! #define GPS_PACKET_END2 0x0A //last byte of gps packet // This isn't used yet, but should be. --- 93,114 ---- #define GPS_DATA_LENGTH 128 ! #define GPS_PACKET_START 0x24 //start of gps packet ! #define GPS_PACKET_END1 0x0D //penultimate byte of NMEA string ! #define GPS_PACKET_END2 0x0A //ultimate byte of NMEA string ! ! // Carriage return, ASCII 13 ! #define NMEA_END1 "\r" //0x0D //penultimate byte of NMEA string ! // Line feed, ASCII 10 ! #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. *************** *** 98,101 **** --- 116,130 ---- #define GPS_POWER_ON 1 + const uint8_t gps_power_on = 0; + + + /** + * Predefined "programs" useful for setting various states + * of the GPS unit. These are all in NMEA format. + */ + const uint8_t gps_gga_mask[] = {"$PFST,NMEA,"NMEA_GGA_MASK NMEA_END1 NMEA_END2}; + //const uint8_t gps_rmc_mask[] = {"$PFST,NMEA",NMEA_RMC_MASK,",",NMEA_END1,",",NMEA_END2}; + + typedef struct _gga_msg GGA_Msg; *************** *** 104,107 **** --- 133,137 ---- typedef GPS_Msg * GPS_MsgPtr; + struct _gps_msg { Index: gps_driver.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driver.nc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gps_driver.nc 6 Jan 2004 16:29:47 -0000 1.2 --- gps_driver.nc 14 Jan 2004 14:05:34 -0000 1.3 *************** *** 53,57 **** MicaWbSwitch, UARTGpsPacket, - //TimerC, LedsC; --- 53,56 ---- *************** *** 59,70 **** gps_driverM.StdControl = StdControl; Sensor = gps_driverM; - //StdControl = TimerC; StdControl = MicaWbSwitch; gps_driverM.Leds -> LedsC; - //gps_driverM.GPSTimer -> TimerC.Timer[unique("Timer")]; - //gps_driverM.REDTimer -> TimerC.Timer[unique("Timer")]; - /** Use gps without sensirion or adxl. */ //gps_driverM.SwitchControl -> MicaWbSwitch.StdControl; gps_driverM.PowerSwitch -> MicaWbSwitch.Switch[0]; --- 58,65 ---- Index: gps_driverM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/fireboard/sensors/leadtek9546/gps_driverM.nc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gps_driverM.nc 5 Jan 2004 21:03:27 -0000 1.1.1.1 --- gps_driverM.nc 14 Jan 2004 14:05:34 -0000 1.2 *************** *** 39,43 **** command result_t log_gga_data_to_eeprom(GGA_Msg * pGGA); - //command result_t log_gga_data_to_eeprom(GGA_Msg * pGGA); } --- 39,42 ---- *************** *** 151,193 **** } - /** FIXME: Make sure we don't need the startDone, stopDone - * calls. - */ event result_t PowerSwitch.setDone(bool local_result) { - - #if 0 - switch(state) { - - case MAIN_SWITCH_ON: - SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_ON\n"); - state = IDLE; - /** GpsControl is wired to GpsPacket.nc */ - //signal GpsControl.startDone(); - break; - - case MAIN_SWITCH_OFF: - SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_OFF\n"); - state = POWEROFF; - /** GpsControl is wired to GpsPacket.nc */ - //signal GpsControl.stopDone(); - break; - - case WAIT_SWITCH_ON: - SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_ON\n"); - if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { - state = MAIN_SWITCH_ON; - } - break; - - case WAIT_SWITCH_OFF: - SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_OFF\n"); - if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { - state = MAIN_SWITCH_OFF; - } - default: - break; - } - #endif - return SUCCESS; } --- 150,154 ---- *************** *** 207,238 **** } - /** FIXME: Rewrite this with a switch/case. */ - /** FIXME: I see no reason why we need I2C information this - * high in the application. All this I2C bus info needs - * to be shoved down a level, and wired from here to something - * like turnSensorOn(), turnSensorOff(), etc. - */ event result_t IOSwitch.setDone(bool local_result) { - - //SODbg(DBG_USR2, "gps_driverM.IOSwitch.setDone(): state: %i \n", state); - #if 0 - if (state == OPENSCK) { //SCK line enabled - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SCK enabled \n"); - state = OPENDATA; - return call IOSwitch.set(MICAWB_HUMIDITY_DATA,1); - } else if (state == OPENDATA) { //Data line enabled - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SDA enabled \n"); - state = TIMER; - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): Timer Started, state: %i \n", - state); - return call GPSTimer.start(TIMER_ONE_SHOT, 100); - } else if (state == CLOSESCK) { - state = CLOSEDATA; - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SCK disabled \n"); - return call IOSwitch.set(MICAWB_HUMIDITY_DATA,0); - } else if (state == CLOSEDATA) { - SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SDA disabled \n"); - } - #endif return SUCCESS; } --- 168,172 ---- *************** *** 248,261 **** command result_t isGGA(uint8_t * data) { - //SODbg(DBG_USR2, "firebugM.isGGA()\n"); - //UARTPutChar(data[3]); - //UARTPutChar(data[4]); - //UARTPutChar(data[5]); - if ( (data[3] == 'G') && (data[4] == 'G') && (data[5] == 'A')) { ! ! //SODbg(DBG_USR2, "\n"); return TRUE; } --- 182,193 ---- command result_t isGGA(uint8_t * data) { if ( (data[3] == 'G') && (data[4] == 'G') && (data[5] == 'A')) { ! return TRUE; ! } ! else if ( (data[3] == 'R') && ! (data[4] == 'M') && ! (data[5] == 'C')) { return TRUE; } *************** *** 372,381 **** event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { ! uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! int8_t gga_string[GPS_MSG_LENGTH]; ! bool gga_read = FALSE; ! bool gga_read_done = FALSE; call Leds.greenToggle(); --- 304,314 ---- event TOS_MsgPtr GpsReceive.receive(TOS_MsgPtr data) { ! //uint8_t i; GPS_MsgPtr gps_data = (GPS_MsgPtr)data; ! /** Save these for now. */ ! //int8_t gga_string[GPS_MSG_LENGTH]; ! //bool gga_read = FALSE; ! //bool gga_read_done = FALSE; call Leds.greenToggle(); *************** *** 384,389 **** --- 317,325 ---- SODbg(DBG_USR2, "gps_driverM.GpsReceive.receive() GGA Data\n"); signal Sensor.dataReady(gps_data); + signal Sensor.dataReady((void*)gps_gga_mask); } + + #if 0 uint8_t j = 0; --- sensorboard.h DELETED --- |