2010-09-06 17:18:32 -03:00
|
|
|
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: t -*-
|
|
|
|
|
|
|
|
#include "GPS.h"
|
2010-10-17 01:07:46 -03:00
|
|
|
#include "WProgram.h"
|
2010-09-06 17:18:32 -03:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2010-10-17 01:07:46 -03:00
|
|
|
int
|
2010-10-17 17:13:53 -03:00
|
|
|
GPS::status(void)
|
|
|
|
{
|
2010-10-17 01:07:46 -03:00
|
|
|
if (millis() - _lastTime >= 500){
|
|
|
|
return 0;
|
|
|
|
} else if (fix == 0) {
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-17 17:13:53 -03:00
|
|
|
void
|
|
|
|
GPS::_setTime(void)
|
|
|
|
{
|
|
|
|
_lastTime = millis();
|
|
|
|
}
|
|
|
|
|
2010-09-06 17:18:32 -03:00
|
|
|
void
|
|
|
|
GPS::_error(const char *fmt, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
|
|
|
|
if (print_errors && stderr) {
|
|
|
|
va_start(ap, fmt);
|
|
|
|
vfprintf(stderr, fmt, ap);
|
|
|
|
va_end(ap);
|
|
|
|
}
|
|
|
|
}
|