diff --git a/ArduCopterMega/ArduCopterMega.pde b/ArduCopterMega/ArduCopterMega.pde index 715fa46572..e9fe2e8fb4 100644 --- a/ArduCopterMega/ArduCopterMega.pde +++ b/ArduCopterMega/ArduCopterMega.pde @@ -525,7 +525,7 @@ void medium_loop() medium_loopCounter++; - if(Serial1.available() > 0){ + if(GPS_disabled == false){ update_GPS(); } @@ -785,7 +785,6 @@ void update_GPS(void) update_GPS_light(); if (g_gps->new_data && g_gps->fix) { - GPS_disabled = false; // XXX We should be sending GPS data off one of the regular loops so that we send // no-GPS-fix data too diff --git a/ArduCopterMega/system.pde b/ArduCopterMega/system.pde index f698fd3f79..6e87090688 100644 --- a/ArduCopterMega/system.pde +++ b/ArduCopterMega/system.pde @@ -254,8 +254,20 @@ void startup_ground(void) // ------------------- init_commands(); - // clear out the GPS buffer - Serial1.flush(); + byte counter = 4; + GPS_disabled = true; + + // Read in the GPS + for (byte counter = 0; ; counter++) { + g_gps->update(); + if (g_gps->status() != 0){ + break; + } + if (counter >= 4) { + GPS_disabled = true; + break; + } + } gcs.send_text_P(SEVERITY_LOW,PSTR("\n\n Ready to FLY.")); }