Make the GPS serial UI smarter at giving progress updates
If onylt he serial monitor handled \r properly.....
This commit is contained in:
parent
4d394b1978
commit
188c74e2d6
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue