From 539039f03772621f98c6b0ca7566fec6954efc88 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 10 Jan 2013 19:03:41 +0100 Subject: [PATCH] Set heading to 0 when speed is 0. --- dump1090.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dump1090.c b/dump1090.c index e50edd7..14ce277 100644 --- a/dump1090.c +++ b/dump1090.c @@ -893,6 +893,8 @@ void decodeModesMessage(struct modesMessage *mm, unsigned char *msg) { mm->heading = heading * 360 / (M_PI*2); /* We don't want negative values but a 0-360 scale. */ if (mm->heading < 0) mm->heading += 360; + } else { + mm->heading = 0; } } else if (mm->mesub == 3 || mm->mesub == 4) { mm->heading_is_valid = msg[5] & (1<<2);