icE1usb fw/gpsdo: Only force HOLD_OVER when no PPS if not DISABLED

Bug introduced in da395cc922
but since we never had anyway to use manual mode before,
didn't get noticed ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I6e2b6cf5c7c0c9deaf429be000770316ec88b9d4
This commit is contained in:
Sylvain Munaut 2022-10-06 09:52:57 +02:00
parent ac4392d0e1
commit 166d49d785
1 changed files with 2 additions and 1 deletions

View File

@ -278,7 +278,8 @@ gpsdo_poll(void)
bool valid;
/* If more than 3 sec elapsed since last PPS, go to hold-over */
if (time_elapsed(g_gpsdo.meas.tick_prev, 3 * SYS_CLK_FREQ)) {
if ((g_gpsdo.state != STATE_DISABLED) &&
time_elapsed(g_gpsdo.meas.tick_prev, 3 * SYS_CLK_FREQ)) {
g_gpsdo.state = STATE_HOLD_OVER;
g_gpsdo.meas.invalid = 0;
g_gpsdo.meas.skip = 0;