You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
|
|
|
|
|
|
|
|
#include "GPS.h"
|
|
|
|
#include "WProgram.h"
|
|
|
|
|
|
|
|
int
|
|
|
|
GPS::status(void)
|
|
|
|
{
|
|
|
|
if (millis() - _lastTime >= 500){
|
|
|
|
return 0;
|
|
|
|
} else if (fix == 0) {
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GPS::_setTime(void)
|
|
|
|
{
|
|
|
|
_lastTime = millis();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
GPS::update(void)
|
|
|
|
{
|
|
|
|
if (!status())
|
|
|
|
{
|
|
|
|
Serial.println("Reinitializing GPS");
|
|
|
|
init();
|
|
|
|
_setTime();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
read();
|
|
|
|
}
|
|
|
|
}
|