2017年伊豆大島共同打ち上げ実験用電装モジュール搭載GPS測位プログラム

Dependents:   Hybrid_interruptGPS Hybrid_main_FirstEdtion rocket_logger_sinkan2018_v1 HYBRYD2018_IZU_ROCKET ... more

Revision:
6:2f91c71d64b1
Parent:
4:758f97bee95a
Child:
7:4b893ac95ae1
--- 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);