Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MTDOT-EVB-LinkCheck-AL MTDOT-BOX-EVB-Factory-Firmware-LIB-108 TelitSensorToCloud mDot_sensor_to_cloud ... more
Diff: GPSPARSER.cpp
- Revision:
- 9:a4d4ab3b0f23
- Parent:
- 8:5fa40fa372e2
- Child:
- 10:465f9db415ea
--- a/GPSPARSER.cpp Mon Dec 14 08:58:14 2015 -0600
+++ b/GPSPARSER.cpp Mon Dec 14 09:08:31 2015 -0600
@@ -60,9 +60,7 @@
if (GPSPARSER::initGps() == 0) {
_gps_detected = true;
_getSentenceThread.signal_set(START_THREAD);
- //printf("Started Nema Sentence Thread\r\n");
} else {
- //printf("No GPS detected\r\n");
_fix_status = 0;
}
@@ -88,10 +86,8 @@
uint8_t ret = 0;
_gps_uart->rxClear();
- //printf("Starting initGPS \r\n");
_gps_uart->write(init_gps,16);
- //printf("wrote control data\r\n");
do {
osDelay(10);
@@ -104,38 +100,28 @@
_gps_uart->read(chk_char,20);
} while ((chk_char != 0xA0) && (!_gps_uart->rxEmpty()));
- //printf ("found 0xA0 or rx empty\r\n");
-
if (chk_char == 0xA0) {
_gps_uart->read(chk_char,15);
if (chk_char != 0xA1) {
- //printf( "initGPS failed no message\r\n");
ret = 1;
} else {
- //printf("message received\r\n");
_gps_uart->read(chk_char);
_gps_uart->read(chk_char);
- //printf("message size - %x\r\n",chk_char);
_gps_uart->read(chk_char);
if (chk_char != 0x83) {
- //printf("initGPS failed not ack message\r\n");
ret = 1;
} else {
- //printf("ACK message received\r\n");
_gps_uart->read(chk_char);
//printf("config message acknowledged - ID - %x\r\n",chk_char);
}
}
} else {
- //printf("rx empty \r\n");
ret = 1;
}
} else {
- //printf("No readable characters\r\n");
ret = 1;
}
- //printf("initGps done\r\n");
return ret;
}
@@ -155,7 +141,6 @@
char cksum_str[2];
_getSentenceThread.signal_wait(START_THREAD);
- //printf("Got thread start\r\n");
if (_led) {
_tick.attach(this, &GPSPARSER::blinker, 0.5);
_tick_running = true;
@@ -186,7 +171,7 @@
}
} while (( chk_char != 0x0D) && !_gps_uart->rxEmpty());
- if (nema_cksum == calc_cksum)
+ if (nema_cksum == calc_cksum) {
if (strncmp (nema_str,"GGA",3) == 0)
parseGGA(nema_str);
else if (strncmp (nema_str,"GSA",3) == 0)
@@ -202,12 +187,13 @@
else if (strncmp (nema_str,"ZDA",3) == 0)
parseZDA(nema_str);
else
- //printf("Unknown NEMA String Type\r\n");
- else
- //printf("NEMA String checksum error %x != %x\r\n",nema_cksum,calc_cksum);
+ printf("Unknown NEMA String Type\r\n");
+ } else {
+ printf("NEMA String checksum error %x != %x\r\n",nema_cksum,calc_cksum);
+ }
}
} else
- //printf("RX empty before all data read\r\n");
+ printf("RX empty before all data read\r\n");
}
if (_led) {