projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altoslib: Reset consecutive GPS count when GPS bad
[fw/altos]
/
ao-tools
/
lib
/
cc-logfile.c
diff --git
a/ao-tools/lib/cc-logfile.c
b/ao-tools/lib/cc-logfile.c
index b0fff9f8c0ea7f01d0be54449b1ff77cbead2c70..c193b1c7f5ec4f3a3120dfa392898b1d42d90b21 100644
(file)
--- a/
ao-tools/lib/cc-logfile.c
+++ b/
ao-tools/lib/cc-logfile.c
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-263,6
+264,9
@@
read_telem(const char *line, struct cc_flightraw *f)
{
struct cc_telem telem;
struct cc_gpselt gps;
{
struct cc_telem telem;
struct cc_gpselt gps;
+ struct cc_gpssat sat;
+ int s;
+
if (!cc_telem_parse(line, &telem))
return 0;
f->ground_accel = telem.ground_accel;
if (!cc_telem_parse(line, &telem))
return 0;
f->ground_accel = telem.ground_accel;
@@
-288,6
+292,12
@@
read_telem(const char *line, struct cc_flightraw *f)
gps.second = telem.gps.gps_time.second;
gpsdata_add(&f->gps, &gps);
}
gps.second = telem.gps.gps_time.second;
gpsdata_add(&f->gps, &gps);
}
+ for (s = 0; s < telem.gps_tracking.channels; s++) {
+ sat.time = telem.tick;
+ sat.svid = telem.gps_tracking.sats[s].svid;
+ sat.c_n = telem.gps_tracking.sats[s].c_n0;
+ gpssat_add(&f->gps, &sat);
+ }
return 1;
}
return 1;
}
@@
-296,8
+306,8
@@
cc_log_read(FILE *file)
{
struct cc_flightraw *f;
char line[8192];
{
struct cc_flightraw *f;
char line[8192];
- double ground_pres;
- int ground_pres_count;
+ double ground_pres
= 0.0
;
+ int ground_pres_count
= 0
;
f = calloc(1, sizeof (struct cc_flightraw));
if (!f)
f = calloc(1, sizeof (struct cc_flightraw));
if (!f)