diff options
| -rw-r--r-- | app/main.c | 1 | ||||
| -rw-r--r-- | app/pll.c | 20 | ||||
| -rw-r--r-- | app/project.h | 3 | 
3 files changed, 17 insertions, 7 deletions
@@ -49,6 +49,7 @@ static void  board_setup (void)  {    rcc_osc_bypass_enable (HSE); +  RCC_SSCGR=0;    rcc_clock_setup_hse_3v3 (&hse_10mhz_3v3_168);    rcc_periph_clock_enable (RCC_SYSCFG); @@ -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; diff --git a/app/project.h b/app/project.h index fa8d5b2..d19cd61 100644 --- a/app/project.h +++ b/app/project.h @@ -42,7 +42,8 @@  #include "prototypes.h" -#define HZ 168000000 +#define HZ 167999973 +//#define HZ 168000000  //#define HZ 167968615  //#define HZ 165925490  //#define HZ 167996682  | 
