From e1189839fecdffa2fb3cbf1c6d69886be61e86fe Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 1 Feb 2020 05:02:12 -0800 Subject: [PATCH] on initial powerup GPS generates a fake zero alt report (before lock) --- main/main.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/main.ino b/main/main.ino index 64f5176..6ed1511 100644 --- a/main/main.ino +++ b/main/main.ino @@ -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());