Refactor gps a teeny bit
This commit is contained in:
parent
bbf12da323
commit
5b4b36ddad
1 changed files with 14 additions and 1 deletions
|
@ -18,6 +18,7 @@ GPSLocation gps_fetch() {
|
|||
|
||||
Serial.print(F("[gps] Working: "));
|
||||
uint32_t ms_last_update = millis();
|
||||
uint8_t ticks = 0;
|
||||
// We WILL discover our location - if it's the last thing we do!
|
||||
while(true) {
|
||||
if(millis() > 5000 && gps.charsProcessed() < 10) {
|
||||
|
@ -40,7 +41,19 @@ GPSLocation gps_fetch() {
|
|||
#endif
|
||||
) {
|
||||
// NOTE: It can take a rather long time to get a lock. Just wait patiently :-)
|
||||
if(millis() - ms_last_update > 500) Serial.print(".");
|
||||
if(millis() - ms_last_update > 500) {
|
||||
ticks++;
|
||||
Serial.print(gps.time.isValid() ? '-' : '.');
|
||||
if(ticks > 80) {
|
||||
Serial.println();
|
||||
ticks = 0;
|
||||
}
|
||||
// Serial.println(gps.location.lat());
|
||||
// Serial.println(gps.location.lng());
|
||||
// Serial.println(gps.date.year());
|
||||
// Serial.println(gps.time.hour());
|
||||
// Serial.println(gps.time.minute());
|
||||
}
|
||||
ms_last_update = millis();
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue