summaryrefslogtreecommitdiffstats
path: root/app/stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/stats.c')
-rw-r--r--app/stats.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/app/stats.c b/app/stats.c
new file mode 100644
index 0000000..dfed017
--- /dev/null
+++ b/app/stats.c
@@ -0,0 +1,44 @@
+#include "project.h"
+
+
+void stats (void)
+{
+ int64_t d;
+ EPOCH e;
+ UTC m, g;
+ float ms;
+
+ d = msf_last_second;
+ d -= (int64_t) dcf77_last_second;
+
+ g = time_epoch_to_utc (pll_decompose (dcf77_last_second));
+ m = time_epoch_to_utc (pll_decompose (msf_last_second));
+ e = pll_decompose_diff (d);
+
+ ms = (float) e.ns;
+ ms = ms / 1000000.0;
+
+ printf ("MSF %02d:%02d:%02d.%09d %02d.%09d %+.6f ms %u\r\n",
+ m.hour,
+ m.minute,
+ m.second,
+ m.nanosecond,
+ g.second,
+ g.nanosecond,
+ ms,
+ (unsigned) pll_freq);
+
+}
+void stats_stamp (UTC m, uint64_t abs)
+{
+ uint32_t v, w;
+ v = msf_last_second & 0xffffffff;
+ w = msf_last_second >> 32;
+
+ printf ("STAMP: %02d:%02d:%02d %08x`%08x\r\n", m.hour,
+ m.minute,
+ m.second,
+ w, v);
+
+
+}