icE1usb fw/gpsdo: Never use invalid measurements to feed loop

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I9c7b81c6e2e600ed49ac766fa33df23747dd339e
This commit is contained in:
Sylvain Munaut 2022-04-21 23:27:57 +02:00
parent 28eb5d1b96
commit 8014c3cd09
1 changed files with 4 additions and 3 deletions

View File

@ -286,10 +286,11 @@ gpsdo_poll(void)
} else {
/* Count invalid measurements and if too many of
* them, we go back to hold-over */
if (++g_gpsdo.meas.invalid >= MAX_INVALID) {
if (++g_gpsdo.meas.invalid >= MAX_INVALID)
g_gpsdo.state = STATE_HOLD_OVER;
return;
}
/* In all cases, invalid measurements are not used */
return;
}
g_gpsdo.meas.invalid = 0;