[Firebug-cvs] fireboard/beta/apps/GPS3 TestMTS400M.nc,1.1,1.2
Brought to you by:
doolin
From: David M. D. <do...@us...> - 2005-09-20 00:21:05
|
Update of /cvsroot/firebug/fireboard/beta/apps/GPS3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3484 Modified Files: TestMTS400M.nc Log Message: more cleanup. Index: TestMTS400M.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/apps/GPS3/TestMTS400M.nc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestMTS400M.nc 19 Sep 2005 22:34:44 -0000 1.1 --- TestMTS400M.nc 20 Sep 2005 00:20:55 -0000 1.2 *************** *** 72,78 **** // turn on or off one of the GPS messages. This allows testing to see // if messages are making it out to the GPS. - #ifndef NMEA_MESSAGE_TESTING - #define NMEA_MESSAGE_TESTING 0 - #endif --- 72,75 ---- *************** *** 110,130 **** } - #if NMEA_MESSAGE_TESTING - // Test code to determine if messages can be sent to the GPS. MJNewman - // 15Aug05 - //#define NMEA_ENABLE "$PSRF103,05,00,01,01*20\r\n" //VTG on - //#define NMEA_DISABLE "$PSRF103,05,00,00,01*21\r\n" //VTG off - //#define NMEA_ENABLE "$PSRF103,00,00,02,01*26\r\n" //GGA on 2 sec - //#define NMEA_ENABLE "$PSRF103,00,00,08,01*2C\r\n" //GGA on 8 sec ! #define NMEA_ENABLE "\r\n\r\n$PSRF103,01,00,01,01*24\r\n" //GLL on ! #define NMEA_ENABLE_LENGTH strlen(NMEA_ENABLE) ! #define NMEA_DISABLE "\r\n\r\n$PSRF103,01,00,00,01*25\r\n" //GLL off ! #define NMEA_DISABLE_LENGTH strlen(NMEA_DISABLE) - #if 0 #define CHANGE_TO_SIRF_MODE "$PSRF100,0,4800,8,1,0*0F\r\n" #define CHANGE_TO_SIRF_LENGTH strlen(CHANGE_TO_SIRF_MODE) ! static const uint8_t const CHANGE_TO_NMEA_MODE[] = { 0xA0, 0xA2, --- 107,131 ---- } ! // Test code to determine if messages can be sent to the GPS. MJNewman ! // 15Aug05 ! #define VTG_ON "$PSRF103,05,00,01,01*20\r\n" //VTG on ! #define VTG_ON_LENGTH strlen(VTG_ON) ! #define VTG_OFF "$PSRF103,05,00,00,01*21\r\n" //VTG off ! #define VTG_OFF_LENGTH strlen(VTG_OFF) ! ! ! //#define NMEA_ENABLE "$PSRF103,00,00,02,01*26\r\n" //GGA on 2 sec ! //#define NMEA_ENABLE "$PSRF103,00,00,08,01*2C\r\n" //GGA on 8 sec ! ! #define GLL_ON "\r\n\r\n$PSRF103,01,00,01,01*24\r\n" //GLL on ! #define GLL_ON_LENGTH strlen(GLL_ON) ! #define GLL_OFF "\r\n\r\n$PSRF103,01,00,00,01*25\r\n" //GLL off ! #define GLL_OFF_LENGTH strlen(GLL_OFF) ! #define CHANGE_TO_SIRF_MODE "$PSRF100,0,4800,8,1,0*0F\r\n" #define CHANGE_TO_SIRF_LENGTH strlen(CHANGE_TO_SIRF_MODE) ! static const uint8_t CHANGE_TO_NMEA_MODE[] = { 0xA0, 0xA2, *************** *** 165,169 **** #define NMEA_DISABLE CHANGE_TO_SIRF_MODE #define NMEA_DISABLE_LENGTH strlen(CHANGE_TO_SIRF_MODE) ! #endif // send message to the GPS to enable VTG messages on a 1 second cycle --- 166,216 ---- #define NMEA_DISABLE CHANGE_TO_SIRF_MODE #define NMEA_DISABLE_LENGTH strlen(CHANGE_TO_SIRF_MODE) ! ! ! ! task void gll_on() { ! ! if ( call GpsSend.send((char *)GLL_ON , GLL_ON_LENGTH) == SUCCESS) { ! SODbg(DBG_USR2,"GLL ON\n"); ! return; ! }; ! post gll_on(); ! return; ! } ! ! task void gll_off() { ! ! if ( call GpsSend.send(GLL_OFF, GLL_OFF_LENGTH) == SUCCESS) { ! SODbg(DBG_USR2,"GLL OFF\n"); ! return; ! } ! post gll_off(); ! return; ! ! } ! ! ! ! task void vtg_on() { ! ! if ( call GpsSend.send((char *)VTG_ON , VTG_ON_LENGTH) == SUCCESS) { ! SODbg(DBG_USR2,"VTG ON\n"); ! return; ! }; ! post vtg_on(); ! return; ! } ! ! task void vtg_off() { ! ! if ( call GpsSend.send(VTG_OFF, VTG_OFF_LENGTH) == SUCCESS) { ! SODbg(DBG_USR2,"VTG OFF\n"); ! return; ! } ! post vtg_off(); ! return; ! ! } ! // send message to the GPS to enable VTG messages on a 1 second cycle *************** *** 185,198 **** return; } ! #endif event result_t GpsSend.sendDone(uint8_t *sendPtr, result_t status) { ! #if NMEA_MESSAGE_TESTING // SODbg(DBG_USR2, "GPS %s commanded: %s",((status == SUCCESS) ? "OK" : "FAIL"),(char *)sendPtr); ! #endif return SUCCESS; } ! #if NMEA_MESSAGE_TESTING task void disableNMEAmessage() { #if 0 --- 232,245 ---- return; } ! event result_t GpsSend.sendDone(uint8_t *sendPtr, result_t status) { ! //#if NMEA_MESSAGE_TESTING // SODbg(DBG_USR2, "GPS %s commanded: %s",((status == SUCCESS) ? "OK" : "FAIL"),(char *)sendPtr); ! //#endif return SUCCESS; } ! //#if NMEA_MESSAGE_TESTING task void disableNMEAmessage() { #if 0 *************** *** 212,216 **** return; } ! #endif command result_t StdControl.init() { --- 259,263 ---- return; } ! command result_t StdControl.init() { *************** *** 233,236 **** --- 280,284 ---- call GpsControl.start(); + call Timer.start(TIMER_REPEAT, TIMER_PERIOD); //start up sensor measurements return SUCCESS; *************** *** 290,305 **** }; call Leds.redToggle(); ! #if NMEA_MESSAGE_TESTING { static uint8_t cycleCount; cycleCount += 1; if (cycleCount == 5) { ! SODbg(DBG_USR2, "Trying NMEA On\n"); ! post enableNMEAmessage(); return SUCCESS; }; if (cycleCount == 30) { ! SODbg(DBG_USR2, "Trying NMEA OFF\n"); ! post disableNMEAmessage(); return SUCCESS; }; --- 338,357 ---- }; call Leds.redToggle(); ! { static uint8_t cycleCount; cycleCount += 1; if (cycleCount == 5) { ! //SODbg(DBG_USR2, "Trying NMEA On\n"); ! //post enableNMEAmessage(); ! SODbg(DBG_USR2, "Trying GLL On\n"); ! post gll_on(); return SUCCESS; }; if (cycleCount == 30) { ! //SODbg(DBG_USR2, "Trying NMEA OFF\n"); ! //post disableNMEAmessage(); ! SODbg(DBG_USR2, "Trying GLL OFF\n"); ! post gll_off(); return SUCCESS; }; *************** *** 308,312 **** }; } ! #endif // NMEA_MESSAGE_TESTING return SUCCESS; } --- 360,364 ---- }; } ! return SUCCESS; } |