[Firebug-cvs] mts400/apps/TestGPS gps_newM.nc,1.5,1.6
Brought to you by:
doolin
From: <do...@us...> - 2003-11-18 22:45:14
|
Update of /cvsroot/firebug/mts400/apps/TestGPS In directory sc8-pr-cvs1:/tmp/cvs-serv26771/apps/TestGPS Modified Files: gps_newM.nc Log Message: Worked over the debugging output for gps. Index: gps_newM.nc =================================================================== RCS file: /cvsroot/firebug/mts400/apps/TestGPS/gps_newM.nc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gps_newM.nc 13 Nov 2003 00:17:18 -0000 1.5 --- gps_newM.nc 18 Nov 2003 22:45:10 -0000 1.6 *************** *** 37,40 **** --- 37,42 ---- #include "gps.h" + #define GPS_DEBUG 0 + /** 0 means GPS runs forever, 1 means it takes one reading * and powers down. *************** *** 42,46 **** * this should not happen and is a problem. */ ! #define GPS_ONE_SHOT 1 --- 44,48 ---- * this should not happen and is a problem. */ ! #define GPS_ONE_SHOT 0 *************** *** 72,76 **** */ call GpsControl.start(); ! call GPSTimer.start(TIMER_REPEAT, 10000) ; call REDTimer.start(TIMER_REPEAT, 500) ; return SUCCESS; --- 74,79 ---- */ call GpsControl.start(); ! //call GPSTimer.start(TIMER_REPEAT, 10000) ; ! call readGps(); call REDTimer.start(TIMER_REPEAT, 500) ; return SUCCESS; *************** *** 82,86 **** * sensor readings. Timer.stop always returns success. */ ! call GPSTimer.stop(); call REDTimer.stop(); return SUCCESS; --- 85,89 ---- * sensor readings. Timer.stop always returns success. */ ! //call GPSTimer.stop(); call REDTimer.stop(); return SUCCESS; *************** *** 91,95 **** --- 94,100 ---- if (call GpsCmd.PowerSwitch(GPS_POWER_OFF)) { + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.StdControl.stop(): GPS sensor powered off. \n"); + #endif } } *************** *** 102,106 **** --- 107,113 ---- if (gps_state == GPS_WORKING) { + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.readGps(): GPS_WORKING\n"); + #endif return; } *************** *** 110,115 **** /* Implementation is in GpsPacket.nc */ if (call GpsCmd.PowerSwitch(GPS_POWER_ON)) { SODbg(DBG_USR2, "gps_newM.readGps(): GPS powered on\n"); ! gps_state = GPS_WORKING; } } --- 117,124 ---- /* Implementation is in GpsPacket.nc */ if (call GpsCmd.PowerSwitch(GPS_POWER_ON)) { + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.readGps(): GPS powered on\n"); ! #endif ! //gps_state = GPS_WORKING; } } *************** *** 143,147 **** --- 152,158 ---- case MAIN_SWITCH_ON: + #if GPS_DEBUG SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_ON\n"); + #endif state = IDLE; /** GpsControl is wired to GpsPacket.nc */ *************** *** 150,154 **** --- 161,167 ---- case MAIN_SWITCH_OFF: + #if GPS_DEBUG SODbg(DBG_USR2, "PowerSwitch.setDone() MAIN_SWITCH_OFF\n"); + #endif state = POWEROFF; /** GpsControl is wired to GpsPacket.nc */ *************** *** 157,161 **** --- 170,176 ---- case WAIT_SWITCH_ON: + #if GPS_DEBUG SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_ON\n"); + #endif if (call PowerSwitch.set(MICAWB_GPS_POWER,1) == SUCCESS) { state = MAIN_SWITCH_ON; *************** *** 164,168 **** --- 179,185 ---- case WAIT_SWITCH_OFF: + #if GPS_DEBUG SODbg(DBG_USR2, "PowerSwitch.setDone() WAIT_SWITCH_OFF\n"); + #endif if (call PowerSwitch.set(MICAWB_GPS_POWER,0) == SUCCESS) { state = MAIN_SWITCH_OFF; *************** *** 200,218 **** --- 217,245 ---- if (state == OPENSCK) { //SCK line enabled + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SCK enabled \n"); + #endif state = OPENDATA; return call IOSwitch.set(MICAWB_HUMIDITY_DATA,1); } else if (state == OPENDATA) { //Data line enabled + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SDA enabled \n"); + #endif state = TIMER; + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): Timer Started, state: %i \n", state); + #endif return call GPSTimer.start(TIMER_ONE_SHOT, 100); } else if (state == CLOSESCK) { state = CLOSEDATA; + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SCK disabled \n"); + #endif return call IOSwitch.set(MICAWB_HUMIDITY_DATA,0); } else if (state == CLOSEDATA) { + #if GPS_DEBUG SODbg(DBG_USR2, "gps_newM.IOSwitch.setDone(): SDA disabled \n"); + #endif } return SUCCESS; *************** *** 269,274 **** event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { SODbg(DBG_USR2, "GpsSend.sendDone(): state: %i \n", state); ! return SUCCESS; } --- 296,302 ---- event result_t GpsSend.sendDone(TOS_MsgPtr msg, result_t success) { + #if GPS_DEBUG SODbg(DBG_USR2, "GpsSend.sendDone(): state: %i \n", state); ! #endif return SUCCESS; } *************** *** 278,283 **** --- 306,313 ---- char tmp[] = {"Foo"}; + #if GPS_DEBUG //SODbg(DBG_USR2, "gps_new.GpsCmd.SwitchesSet(): PowerState: %i \n\n", PowerState); SODbg(DBG_USR2, "gps_new.GpsCmd.SwitchesSet(): dummy string: %s \n", tmp); + #endif call Leds.yellowOn(); call Leds.redOff(); |