summaryrefslogtreecommitdiffstats
path: root/app/pll.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/pll.c')
-rw-r--r--app/pll.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/app/pll.c b/app/pll.c
index 5fa370e..944e6cc 100644
--- a/app/pll.c
+++ b/app/pll.c
@@ -2,8 +2,8 @@
#define JUMP_THRESH 0.1
#define JUMP_TICKS 30
-#define FEEDBACK 0.001
-#define WARM_UP 3
+#define FEEDBACK 0.01
+#define WARM_UP 30
static int64_t offset;
@@ -47,15 +47,12 @@ static void modify_pll_freq (uint64_t now, int d)
phase = now - pd2;
}
+
void pll_dispatch (uint64_t happy, uint64_t edge, const char *src)
{
double f;
int64_t pd;
- if (warming_up) {
- warming_up--;
- return;
- }
#if 0
@@ -78,12 +75,23 @@ void pll_dispatch (uint64_t happy, uint64_t edge, const char *src)
#endif
+if ((!gps_last_happy) && (!dcf77_last_happy) && (!msf_last_happy)) return;
+
if (happy < gps_last_happy) return;
if (happy < dcf77_last_happy) return;
if (happy < msf_last_happy) return;
+ if (warming_up) {
+ warming_up--;
+ return;
+ }
+
+printf("EDGE %08x%08x\r\n",
+ (uint32_t) (edge >>32),
+ (uint32_t) (edge & 0xffffffff));
+
{
int diff, hf;