diff options
| author | Anthony Towns <aj@erisian.com.au> | 2010-09-05 20:49:34 +1000 | 
|---|---|---|
| committer | Anthony Towns <aj@erisian.com.au> | 2010-09-05 20:49:34 +1000 | 
| commit | ddc83b4c401be965a9947782becf20cc8c54e6a2 (patch) | |
| tree | 3fa313271f3c3e42ca9cc76f8cca1937067ee907 /src/ao_gps_skytraq.c | |
| parent | afea6c264c5ebf12f1d629bd4bc724da86d11b7a (diff) | |
| parent | 3d49d5f69b41c27003dbc5ccf1899014bd13bd99 (diff) | |
Merge branch 'master' of git://git.gag.com/fw/altos
Diffstat (limited to 'src/ao_gps_skytraq.c')
| -rw-r--r-- | src/ao_gps_skytraq.c | 14 | 
1 files changed, 10 insertions, 4 deletions
| diff --git a/src/ao_gps_skytraq.c b/src/ao_gps_skytraq.c index ae8c7ef7..2d3d464c 100644 --- a/src/ao_gps_skytraq.c +++ b/src/ao_gps_skytraq.c @@ -333,14 +333,19 @@ ao_gps(void) __reentrant  			ao_gps_skip_field();	/* sats in view */  			while (ao_gps_char != '*' && ao_gps_char != '\n' && ao_gps_char != '\r') {  				i = ao_gps_tracking_next.channels; -				ao_gps_tracking_next.sats[i].svid = ao_gps_decimal(2);	/* SVID */ +				c = ao_gps_decimal(2);	/* SVID */ +				if (i < AO_MAX_GPS_TRACKING) +					ao_gps_tracking_next.sats[i].svid = c;  				ao_gps_lexchar();  				ao_gps_skip_field();	/* elevation */  				ao_gps_lexchar();  				ao_gps_skip_field();	/* azimuth */ -				if (!(ao_gps_tracking_next.sats[i].c_n_1 = ao_gps_decimal(2)))	/* C/N0 */ -					ao_gps_tracking_next.sats[i].svid = 0; -				ao_gps_tracking_next.channels = i + 1; +				c = ao_gps_decimal(2);	/* C/N0 */ +				if (i < AO_MAX_GPS_TRACKING) { +					if (!(ao_gps_tracking_next.sats[i].c_n_1 = c)) +						ao_gps_tracking_next.sats[i].svid = 0; +					ao_gps_tracking_next.channels = i + 1; +				}  			}  			if (ao_gps_char == '*') {  				uint8_t cksum = ao_gps_cksum ^ '*'; @@ -422,6 +427,7 @@ gps_dump(void) __reentrant  	printf ("Time: %02d:%02d:%02d\n", ao_gps_data.hour, ao_gps_data.minute, ao_gps_data.second);  	printf ("Lat/Lon: %ld %ld\n", ao_gps_data.latitude, ao_gps_data.longitude);  	printf ("Alt: %d\n", ao_gps_data.altitude); +	printf ("Flags: 0x%x\n", ao_gps_data.flags);  	ao_mutex_put(&ao_gps_mutex);  } | 
