|
|
|
@ -13,6 +13,7 @@ void gps_begin() { |
|
|
|
|
|
|
|
|
|
TinyGPSLocation gps_location() { |
|
|
|
|
Serial.print("[gps] Getting location: "); |
|
|
|
|
uint32_t ms_last_update = millis(); |
|
|
|
|
// We WILL discover our location - if it's the last thing we do!
|
|
|
|
|
while(true) { |
|
|
|
|
if(millis() > 5000 && gps.charsProcessed() < 10) { |
|
|
|
@ -32,8 +33,9 @@ TinyGPSLocation gps_location() { |
|
|
|
|
// If we haven't acquired a lock yet, go around again
|
|
|
|
|
// Also go around again if the location is the same hasn't yet been updated (GPS devices are strange)
|
|
|
|
|
if(!gps.location.isValid()) { |
|
|
|
|
Serial.print("."); |
|
|
|
|
delay(100); |
|
|
|
|
// NOTE: It can really take a rather long time to get a lock. Just wait patiently :-)
|
|
|
|
|
if(millis() - ms_last_update > 500) Serial.print("."); |
|
|
|
|
ms_last_update = millis(); |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|