on initial powerup GPS generates a fake zero alt report (before lock)

This commit is contained in:
geeksville 2020-02-01 05:02:12 -08:00
parent 1f01b71d4a
commit e1189839fe

View File

@ -62,7 +62,8 @@ void buildPacket(uint8_t txBuffer[]); // needed for platformio
*/
bool trySend() {
packetSent = false;
if (0 < gps_hdop() && gps_hdop() < 50 && gps_latitude() != 0 && gps_longitude() != 0)
// We also wait for altitude being not exactly zero, because the GPS chip generates a bogus 0 alt report when first powered on
if (0 < gps_hdop() && gps_hdop() < 50 && gps_latitude() != 0 && gps_longitude() != 0 && gps_altitude() != 0)
{
char buffer[40];
snprintf(buffer, sizeof(buffer), "Latitude: %10.6f\n", gps_latitude());