diff --git a/master/master/lib/gps.c b/master/master/lib/gps.c --- a/master/master/lib/gps.c +++ b/master/master/lib/gps.c @@ -119,9 +119,22 @@ char* get_dayofmonth() return dayofmonth; } + +bool gps_hadfix = false; + bool gps_hasfix() { - return strcmp("99.99", get_hdop()); + bool hasFix = get_latitudeTrimmed()[0] != 0x00; + + if(hasFix && !gps_hadfix) { + info_log_msg("Lost GPS fix"); + } + else if(!hasFix && gps_hadfix) { + info_log_msg("Acquired GPS fix"); + } + + gps_hadfix = hasFix; + return hasFix; } char variation[9]; //xxx.xb