From 971cc458aea21832a20b1b087185659d8e9ec2b3 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 19 Feb 2019 23:00:23 +0000 Subject: fix offsets --- app/dcf77.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'app/dcf77.c') diff --git a/app/dcf77.c b/app/dcf77.c index 361e4ca..2e9a9a4 100644 --- a/app/dcf77.c +++ b/app/dcf77.c @@ -54,19 +54,24 @@ static void process_bits (uint64_t abs) u.jday = 0; u.year = le_bcd (bits, 50, 57); u.month = le_bcd (bits, 45, 49); - u.mday = bcd (bits, 36, 41); - u.hour = bcd (bits, 29, 34); - u.minute = bcd (bits, 21, 27); - u.second = 58; + u.mday = le_bcd (bits, 36, 41); + u.hour = le_bcd (bits, 29, 34); + u.minute = le_bcd (bits, 21, 27); + u.second = 0; u.nanosecond = 0; + dcf77_time = time_utc_to_epoch (u); - dcf77_time.s -= 58; -#if 0 + + dcf77_time.s -= 2; /*Message arrives 2s early*/ + + dcf77_time.s -= 3600; /*CET*/ + + if (bits[17]) dcf77_time.s -= 3600; /*CEST*/ + pll_set_offset (dcf77_time, abs); -#endif printf ("DCF77: Next minute is: %02d-%02d-%02d %02d:%02d\r\n", u.year, u.month, u.mday, u.hour, u.minute); time_print_epoch ("DCF77: ", dcf77_time); -- cgit v1.2.3