Commit b4c64de5 authored by li hongming's avatar li hongming

Modify the search direction of HPLL locking

parent f94afdb3
Pipeline #4990 failed with stages
......@@ -21,8 +21,8 @@ void helper_init(struct spll_helper_state *s, int ref_channel)
s->pi.kp = -150;//(int)(0.3 * 32.0 * 16.0); // / 2;
s->pi.ki = -2;//(int)(0.03 * 32.0 * 3.0); // / 2;
#else
s->pi.kp = 150;
s->pi.ki = 2;
s->pi.kp = -150;
s->pi.ki = -2;
#endif
s->pi.anti_windup = 1;
......@@ -89,7 +89,7 @@ void helper_start(struct spll_helper_state *s)
/* Set the bias to the upper end of tuning range. This is to ensure that
the HPLL will always lock on positive frequency offset. */
#if defined(CONFIG_WR_SWITCH)
s->pi.bias = s->pi.y_max;
s->pi.bias = s->pi.y_min;
#else
s->pi.bias = s->pi.y_min;
#endif
......
......@@ -32,11 +32,11 @@ void mpll_init(struct spll_main_state *s, int id_ref,
s->pi.bias = 30000;
#if defined(CONFIG_WR_SWITCH)
if (ljd_present) {
s->pi.kp = 2000;
s->pi.ki = 15;
s->pi.kp = -2000;
s->pi.ki = -15;
} else {
s->pi.kp = 1100; // / 2;
s->pi.ki = 30; // / 2;
s->pi.kp = -1100; // / 2;
s->pi.ki = -30; // / 2;
}
#elif defined(CONFIG_WR_NODE)
s->pi.kp = -1100; // / 2;
......@@ -163,7 +163,7 @@ int mpll_update(struct spll_main_state *s, int tag, int source)
if (s->phase_shift_current < s->phase_shift_target) {
s->phase_shift_current++;
#if defined(CONFIG_WR_SWITCH)
s->adder_ref++;
s->adder_ref--;
#else
s->adder_ref--;
#endif
......@@ -171,7 +171,7 @@ int mpll_update(struct spll_main_state *s, int tag, int source)
s->phase_shift_target) {
s->phase_shift_current--;
#if defined(CONFIG_WR_SWITCH)
s->adder_ref--;
s->adder_ref++;
#else
s->adder_ref++;
#endif
......
......@@ -59,7 +59,7 @@ int ptrackers_update(struct spll_ptracker_state *ptrackers, int tag,
#if defined(CONFIG_WR_NODE)
register int delta = (tag - tag_ref) & ((1 << HPLL_N) - 1);
#else
register int delta = (tag_ref - tag) & ((1 << HPLL_N) - 1);
register int delta = (tag - tag_ref) & ((1 << HPLL_N) - 1);
#endif
register int index = delta >> (HPLL_N - 2);
......
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