summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c334d63)
raw | patch | inline | side by side (parent: c334d63)
author | Pierre Fersing <pierre.fersing@bleemeo.com> | |
Tue, 20 Oct 2015 09:27:41 +0000 (11:27 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 30 Nov 2015 18:19:19 +0000 (19:19 +0100) |
src/ntpd.c | patch | blob | history |
diff --git a/src/ntpd.c b/src/ntpd.c
index 540eb788e0b67e3e481be0b382373de5e5d96218..8e00734c77e7986c9b29aac0d0f500f4ea8c656e 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
int status;
int i;
+ double tscale = 1e-6;
ik = NULL;
ik_num = 0;
" pll offset = %.8f\n"
" pll frequency = %.8f\n" /* drift compensation */
" est error = %.8f\n",
- ntpd_read_fp (ik->offset),
+ (int32_t)ntohl(ik->offset) * tscale,
ntpd_read_fp (ik->freq),
- ntpd_read_fp (ik->esterror));
+ (u_long)ntohl(ik->esterror) * 1e-6);
ntpd_submit ("frequency_offset", "loop", ntpd_read_fp (ik->freq));
- ntpd_submit ("time_offset", "loop", ntpd_read_fp (ik->offset));
- ntpd_submit ("time_offset", "error", ntpd_read_fp (ik->esterror));
+ ntpd_submit ("time_offset", "loop", (int32_t)ntohl(ik->offset) * tscale);
+ ntpd_submit ("time_offset", "error", (u_long)ntohl(ik->esterror) * 1e-6);
free (ik);
ik = NULL;