diff options
| author | Keith Packard <keithp@keithp.com> | 2009-07-17 21:30:53 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-07-17 21:32:17 -0700 | 
| commit | d6749bf24792bb41ca700cf4b8e5e1ac1a63cbf0 (patch) | |
| tree | d74bc78f33786a3cb1d3aa902af51a93e32d9418 /src/ao_gps_print.c | |
| parent | a1da7e871aee75308bc05ce1b7a0dc402e4c9509 (diff) | |
Add AO_GPS_RUNNING state.
This tracks whether the GPS receiver has ever sent a valid report to the
flight computer, allowing the user to tell whether the GPS receiver is
working at all.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_gps_print.c')
| -rw-r--r-- | src/ao_gps_print.c | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ao_gps_print.c b/src/ao_gps_print.c index 5ad8d022..49041af6 100644 --- a/src/ao_gps_print.c +++ b/src/ao_gps_print.c @@ -82,11 +82,14 @@ ao_gps_print(__xdata struct ao_gps_data *gps_data) __reentrant  		       climb_sign,  		       climb / 100,  		       climb % 100); -		printf(" %d.%d(hdop) %5d(herr) %5d(verr)\n", -		       gps_data->hdop, +		printf(" %d.%d(hdop) %5u(herr) %5u(verr)\n", +		       gps_data->hdop / 5, +		       (gps_data->hdop * 2) % 10,  		       gps_data->h_error,  		       gps_data->v_error); -	} else { +	} else if (gps_data->flags & AO_GPS_RUNNING) {  		printf(" unlocked\n"); +	} else { +		printf (" not-connected\n");  	}  }  | 
