summaryrefslogtreecommitdiffstats
path: root/app/dcf77.c
diff options
context:
space:
mode:
authorfishsoupisgood <github@madingley.org>2019-02-20 02:39:38 +0000
committerfishsoupisgood <github@madingley.org>2019-02-20 02:39:38 +0000
commitc93861c733ced9c6659241cea69c7feed56afcce (patch)
treeedcef2f980ae99f8ff8746c585eaf611c940e9ef /app/dcf77.c
parent971cc458aea21832a20b1b087185659d8e9ec2b3 (diff)
downloadclock-c93861c733ced9c6659241cea69c7feed56afcce.tar.gz
clock-c93861c733ced9c6659241cea69c7feed56afcce.tar.bz2
clock-c93861c733ced9c6659241cea69c7feed56afcce.zip
use OCXO, and auto fail-over between different clock sources
Diffstat (limited to 'app/dcf77.c')
-rw-r--r--app/dcf77.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/dcf77.c b/app/dcf77.c
index 2e9a9a4..909188b 100644
--- a/app/dcf77.c
+++ b/app/dcf77.c
@@ -10,7 +10,8 @@
static Event_ring dcf77_ring;
-uint64_t dcf77_last_second;
+static uint64_t dcf77_last_second;
+uint64_t dcf77_last_happy;
void exti15_10_isr (void)
{
@@ -71,8 +72,12 @@ static void process_bits (uint64_t abs)
if (bits[17]) dcf77_time.s -= 3600; /*CEST*/
+ dcf77_last_happy = abs - (int64_t) 60 * (int64_t) HZ;
+
pll_set_offset (dcf77_time, abs);
+
+
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);
@@ -161,7 +166,7 @@ void dcf77_dispatch (void)
abs = abs_extend (now);
dcf77_last_second = abs;
- //pll_dispatch (abs);
+ pll_dispatch (dcf77_last_happy, abs, "DCF77");
if (time_known)
report_time (abs);