oops - I broke compass display with my gps changes and didn't notice till

testing with two gps equipped devices.  fixed.
pull/44/head
geeksville 2020-03-18 18:34:22 -07:00
rodzic 53765298e1
commit c8b95f7691
2 zmienionych plików z 12 dodań i 9 usunięć

Wyświetl plik

@ -146,7 +146,9 @@ void GPS::doTask()
ublox.checkUblox(); // See if new data is available. Process bytes as they come in.
// If we don't have a fix (a quick check), don't try waiting for a solution)
fixtype = ublox.getFixType();
// Hmmm my fix type reading returns zeros for fix, which doesn't seem correct, because it is still sptting out positions
// turn off for now
// fixtype = ublox.getFixType();
DEBUG_MSG("fix type %d\n", fixtype);
}
@ -154,7 +156,7 @@ void GPS::doTask()
// DEBUG_MSG("lat %d\n", ublox.getLatitude());
// any fix that has time
if ((fixtype >= 2 && fixtype <= 5) && !timeSetFromGPS && ublox.getT()) {
if (!timeSetFromGPS && ublox.getT()) {
struct timeval tv;
/* Convert to unix time

Wyświetl plik

@ -329,14 +329,15 @@ void MeshService::onGPSChanged()
MeshPacket *p = allocForSending();
p->payload.which_variant = SubPacket_position_tag;
#if 0
Position &pos = p->payload.variant.position;
if (gps.altitude.isValid())
pos.altitude = gps.altitude.meters();
pos.latitude = gps.location.lat();
pos.longitude = gps.location.lng();
pos.time = gps.getValidTime();
#endif
// !zero or !zero lat/long means valid
if(gps.latitude != 0 || gps.longitude != 0) {
if (gps.altitude != 0)
pos.altitude = gps.altitude;
pos.latitude = gps.latitude;
pos.longitude = gps.longitude;
pos.time = gps.getValidTime();
}
// We limit our GPS broadcasts to a max rate
static uint32_t lastGpsSend;