diff options
Diffstat (limited to 'app/pll.c')
-rw-r--r-- | app/pll.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -105,16 +105,26 @@ void pll_dispatch (uint64_t edge) void pll_set_offset (EPOCH epoch, uint64_t abs) { + int64_t new_offset; + int diff; + /* Find nearest second to abs*/ abs += pll_freq >> 2; abs -= phase; abs /= pll_freq; - offset = epoch.s - abs; + new_offset = epoch.s - abs; + + if (new_offset != offset) { + diff = (int) (new_offset - offset); + + + printf ("PLL wallclock offset moved by %d\r\n", diff); + offset = new_offset; + } pll_valid = 1; time_known = 1; - } |