Compare commits

..

5 Commits
0.9.2 ... 0.9.3

Author SHA1 Message Date
Kevin Hester
82fe55471d Merge pull request #331 from geeksville/master
hotfix
2020-08-22 09:15:51 -07:00
geeksville
60d90c4533 Merge remote-tracking branch 'root/master' 2020-08-22 09:10:33 -07:00
geeksville
9145945efa 0.9.3 2020-08-22 09:10:08 -07:00
geeksville
7b09fbe049 fix #327 side effect noticed by @smarti2019 2020-08-22 09:06:54 -07:00
geeksville
a90bab5455 this seems bad - this value was not inited if it wasn't in bss 2020-08-21 10:56:54 -07:00
3 changed files with 65 additions and 60 deletions

View File

@@ -1,3 +1,3 @@
export VERSION=0.9.2 export VERSION=0.9.3

View File

@@ -20,7 +20,7 @@ namespace meshtastic
CallbackObserver<Status, const Status *> statusObserver = CallbackObserver<Status, const Status *>(this, &Status::updateStatus); CallbackObserver<Status, const Status *> statusObserver = CallbackObserver<Status, const Status *>(this, &Status::updateStatus);
bool initialized = false; bool initialized = false;
// Workaround for no typeid support // Workaround for no typeid support
int statusType; int statusType = 0;
public: public:
// Allows us to generate observable events // Allows us to generate observable events

View File

@@ -102,8 +102,13 @@ bool UBloxGPS::factoryReset()
// It is useful to force back into factory defaults (9600baud, NEMA to test the behavior of boards that don't have // It is useful to force back into factory defaults (9600baud, NEMA to test the behavior of boards that don't have
// GPS_TX connected) // GPS_TX connected)
ublox.factoryReset(); ublox.factoryReset();
delay(3000); delay(5000);
tryConnect(); // sets isConnected tryConnect(); // sets isConnected
// try a second time, the ublox lib serial parsing is buggy?
if (!tryConnect())
tryConnect();
DEBUG_MSG("GPS Factory reset success=%d\n", isConnected); DEBUG_MSG("GPS Factory reset success=%d\n", isConnected);
if (isConnected) if (isConnected)
ok = setUBXMode(); ok = setUBXMode();
@@ -122,12 +127,11 @@ int UBloxGPS::prepareSleep(void *unused)
void UBloxGPS::doTask() void UBloxGPS::doTask()
{ {
uint8_t fixtype = 3; // If we are only using the RX pin, assume we have a 3d fix if (isConnected) {
assert(isConnected);
// Consume all characters that have arrived // Consume all characters that have arrived
uint8_t fixtype = 3; // If we are only using the RX pin, assume we have a 3d fix
// if using i2c or serial look too see if any chars are ready // if using i2c or serial look too see if any chars are ready
ublox.checkUblox(); // See if new data is available. Process bytes as they come in. ublox.checkUblox(); // See if new data is available. Process bytes as they come in.
@@ -145,8 +149,8 @@ void UBloxGPS::doTask()
if (ublox.getT(maxWait)) { if (ublox.getT(maxWait)) {
/* Convert to unix time /* Convert to unix time
The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January
(midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).
*/ */
struct tm t; struct tm t;
t.tm_sec = ublox.getSecond(0); t.tm_sec = ublox.getSecond(0);
@@ -185,9 +189,10 @@ The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of s
const meshtastic::GPSStatus status = const meshtastic::GPSStatus status =
meshtastic::GPSStatus(hasLock(), isConnected, latitude, longitude, altitude, dop, heading, numSatellites); meshtastic::GPSStatus(hasLock(), isConnected, latitude, longitude, altitude, dop, heading, numSatellites);
newStatus.notifyObservers(&status); newStatus.notifyObservers(&status);
}
// Once we have sent a location once we only poll the GPS rarely, otherwise check back every 1s until we have something over // Once we have sent a location once we only poll the GPS rarely, otherwise check back every 10s until we have something
// the serial // over the serial
setPeriod(hasValidLocation && !wantNewLocation ? 30 * 1000 : 10 * 1000); setPeriod(hasValidLocation && !wantNewLocation ? 30 * 1000 : 10 * 1000);
} }