summaryrefslogtreecommitdiffstats
path: root/app/pll.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/pll.c')
-rw-r--r--app/pll.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/pll.c b/app/pll.c
index 0c9ed80..43fb9ad 100644
--- a/app/pll.c
+++ b/app/pll.c
@@ -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;
-
}