Move Mode C altitude calc into mode A/C message decoding.
If SPI is set, it cannot be mode C.
This commit is contained in:
parent
85aa200947
commit
7a58e3cdc5
2 changed files with 27 additions and 22 deletions
6
track.c
6
track.c
|
@ -73,13 +73,9 @@ struct aircraft *trackCreateAircraft(struct modesMessage *mm) {
|
|||
// set them once here during initialisation, and don't bother to set them every
|
||||
// time this ModeA/C is received again in the future
|
||||
if (mm->msgtype == 32) {
|
||||
int modeC = ModeAToModeC(mm->modeA | mm->fs);
|
||||
a->modeACflags = MODEAC_MSG_FLAG;
|
||||
if (modeC < -12) {
|
||||
if (!(mm->bFlags & MODES_ACFLAGS_ALTITUDE_VALID)) {
|
||||
a->modeACflags |= MODEAC_MSG_MODEA_ONLY;
|
||||
} else {
|
||||
mm->altitude = modeC * 100;
|
||||
mm->bFlags |= MODES_ACFLAGS_ALTITUDE_VALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue