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: Hybrid_interruptGPS Hybrid_main_FirstEdtion rocket_logger_sinkan2018_v1 HYBRYD2018_IZU_ROCKET ... more
Diff: GPS_interrupt.cpp
- Revision:
- 6:2f91c71d64b1
- Parent:
- 4:758f97bee95a
- Child:
- 7:4b893ac95ae1
diff -r 15ff963f066b -r 2f91c71d64b1 GPS_interrupt.cpp
--- a/GPS_interrupt.cpp Sun Jan 15 20:20:56 2017 +0000
+++ b/GPS_interrupt.cpp Tue Feb 21 13:42:00 2017 +0000
@@ -41,8 +41,18 @@
}
return val;
}
+GPS_interrupt::GPS_interrupt(Serial *_gps){
-GPS_interrupt::GPS_interrupt(RawSerial *_gps, int _frequency){
+ debugFlag = false;
+ initialize();
+ baudrate = 115200;//_baudrate;
+ frequency = 10;
+ gps_irq = this;
+ gps = _gps;
+ gps->attach(gps_irq, &GPS_interrupt::gps_auto_receive, Serial::RxIrq);
+}
+
+GPS_interrupt::GPS_interrupt(Serial *_gps, int _frequency){
debugFlag = false;
initialize();
@@ -177,6 +187,8 @@
classify_AB = ~classify_AB;
}
+ if(debugFlag) printf("debug \"%s\"\r\n", gps_read_buffer);
+
if((strncmp(gps_read_buffer, "$GPRMC", 6) == 0) || (strncmp(gps_read_buffer, "$GNRMC", 6) == 0)){
memset(str_temp, '\0', 128);
strcpy(str_temp, gps_read_buffer);
@@ -194,7 +206,6 @@
}
}
- if(debugFlag) printf("debug \"%s\"\r\n", gps_read_buffer);
//else if(strncmp(gps_read_buffer, "$GPGSV", 6) == 0){
//printf("%s\r\n", gps_read_buffer);