Browse Source

Make the GPS serial UI smarter at giving progress updates

If onylt he serial monitor handled \r properly.....
master
Starbeamrainbowlabs 3 years ago
parent
commit
188c74e2d6
  1. 6
      iot/main/gps.cpp

6
iot/main/gps.cpp

@ -13,6 +13,7 @@ void gps_begin() { @@ -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() { @@ -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;
}

Loading…
Cancel
Save