Commit 4a319b43 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

new softpll little changes to follow switch-hdl repo

parent 80bf6284
......@@ -23,15 +23,14 @@ static volatile struct SPLL_WB *SPLL = (volatile struct SPLL_WB *) BASE_SOFTPLL;
#include "spll_main.h"
#include "spll_ptracker.h"
static struct spll_helper_state helper;
static struct spll_main_state mpll;
static volatile struct spll_helper_state helper;
static volatile struct spll_main_state mpll;
void _irq_entry()
{
volatile uint32_t trr;
int src = -1, tag;
if(! (SPLL->CSR & SPLL_TRR_CSR_EMPTY))
{
trr = SPLL->TRR_R0;
......@@ -62,7 +61,6 @@ void spll_init()
timer_delay(1000);
//GD timer_delay(100000);
//GD
helper_init(&helper, 1);
timer_delay(1000);
TRACE_DEV("delay off\n");
......@@ -91,6 +89,7 @@ void spll_test()
TRACE_DEV("running spll_init\n");
spll_init();
helper_init(&helper, 0);
TRACE_DEV("spll_init\n");
helper_start(&helper);
TRACE_DEV("helper start\n");
......
......@@ -71,7 +71,9 @@ static int helper_update(struct spll_helper_state *s, int tag, int source)
err = (tag + s->p_adder) - s->p_setpoint;
TRACE_DEV("hpll 1err=%d\n", err);
// if(s->tag_d0 - tag > -100000)
TRACE_DEV("%d\n", s->tag_d0 - tag);
//spll_debug(DBG_ERR | DBG_HELPER, s->tag_d0-tag, 1);
if(HELPER_ERROR_CLAMP)
{
......@@ -94,9 +96,9 @@ static int helper_update(struct spll_helper_state *s, int tag, int source)
y = pi_update(&s->pi, err);
SPLL->DAC_HPLL = y;
spll_debug(DBG_SAMPLE_ID | DBG_HELPER, s->sample_n++, 0);
spll_debug(DBG_Y | DBG_HELPER, y, 0);
spll_debug(DBG_ERR | DBG_HELPER, err, 1);
//spll_debug(DBG_SAMPLE_ID | DBG_HELPER, s->sample_n++, 0);
//spll_debug(DBG_Y | DBG_HELPER, y, 0);
//spll_debug(DBG_ERR | DBG_HELPER, err, 1);
if(ld_update(&s->ld, err))
return SPLL_LOCKED;
......
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