From 94be1e3eb9f94a59522743374d02a1f229266931 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 24 Jan 2014 09:21:46 -0800 Subject: [PATCH] altos: Tmega Don't try to log info about more than 12 GPS sats The mega log format has a single packet for GPS info which holds a maximum of 12 satellites. Bdale managed to get 14 sats in view, which ended up crashing the ground station software, and also overflowed the gps_tracking_data structure. Signed-off-by: Keith Packard --- src/core/ao_gps_report_mega.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/ao_gps_report_mega.c b/src/core/ao_gps_report_mega.c index 07a2bc5b..5e3c71bf 100644 --- a/src/core/ao_gps_report_mega.c +++ b/src/core/ao_gps_report_mega.c @@ -70,6 +70,8 @@ ao_gps_report_mega(void) { gps_log.u.gps_sat.sats[i].c_n = gps_tracking_data.sats[c].c_n_1; i++; + if (i >= 12) + break; } gps_log.u.gps_sat.channels = i; ao_log_mega(&gps_log); -- 2.30.2