Set heading to 0 when speed is 0.
This commit is contained in:
parent
af4964d72f
commit
539039f037
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user