Commit f8a949b2 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski

softpll: minor cleanup of the above commit

parent 40d557f0
Pipeline #4971 failed with stage
in 3 minutes and 26 seconds
......@@ -13,8 +13,8 @@
#include "softpll_ng.h"
#define MPLL_DISCARD_EARLY_TAGS 10
#define MPLL_FREQ_LOCK_SAMPLES 6000
#define MPLL_TAG_WRAPAROUND 100000000
#define MPLL_FREQ_PRELOCK_GAIN_BOOST 20
#undef WITH_SEQUENCING
......@@ -53,9 +53,11 @@ void mpll_init(struct spll_main_state *s, int id_ref, int id_out)
/* Freqency branch lock detection */
s->freq_ld.threshold = 50;
s->freq_ld.lock_samples = 10;
s->freq_ld.lock_samples = 50;
s->freq_ld.delock_samples = 20000;
s->freq_prelock_gain_boost = MPLL_FREQ_PRELOCK_GAIN_BOOST;
s->phase_ld.threshold = 1200;
s->phase_ld.lock_samples = 1000;
s->phase_ld.delock_samples = 100;
......@@ -344,7 +346,7 @@ int mpll_update(struct spll_main_state *s, int tag, int source)
if( !s->freq_ld.locked )
{
err = -20 * freq_error;
err = -s->freq_prelock_gain_boost * freq_error;
}
else
{
......@@ -380,7 +382,7 @@ int mpll_update(struct spll_main_state *s, int tag, int source)
if (s->dac_index == 0)
spll_log_dac(y);
spll_debug(s->dbg_src_id, SPLL_DBG_SIGNAL_PHASE_CURRENT, (s->freq_ld.locked ? 1 : 0) + (s->phase_ld.locked ? 10 : 0), 0);
spll_debug(s->dbg_src_id, SPLL_DBG_SIGNAL_PHASE_CURRENT, s->phase_shift_current, 0);
spll_debug(s->dbg_src_id, SPLL_DBG_SIGNAL_PHASE_TARGET, s->phase_shift_target, 0);
spll_debug(s->dbg_src_id, SPLL_DBG_SIGNAL_TIME_MS, timer_get_tics(), 0);
spll_debug(s->dbg_src_id, SPLL_DBG_SIGNAL_REF, s->dref_dt, 0);
......
......@@ -35,6 +35,7 @@ struct spll_main_state {
#endif
int dref_dt, dout_dt, tag_ref_raw_d, tag_out_raw_d2;
int freq_prelock_gain_boost;
int discard_early_cnt;
int adder_ref, adder_out;
int tag_ref, tag_ref_d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment