summaryrefslogtreecommitdiffstats
path: root/app/dcf77.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/dcf77.c')
-rw-r--r--app/dcf77.c19
1 files changed, 12 insertions, 7 deletions
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);