Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PTP noposix stack
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PTP noposix stack
Commits
e0720653
Commit
e0720653
authored
Jul 25, 2012
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
softpll: removed compilation warnings
parent
cf7938ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
30 deletions
+30
-30
softpll_ng.c
softpll/softpll_ng.c
+2
-2
spll_external.h
softpll/spll_external.h
+5
-5
spll_helper.h
softpll/spll_helper.h
+7
-7
spll_main.h
softpll/spll_main.h
+13
-13
spll_ptracker.h
softpll/spll_ptracker.h
+3
-3
No files found.
softpll/softpll_ng.c
View file @
e0720653
...
...
@@ -361,7 +361,7 @@ void spll_start_channel(int channel)
void
spll_stop_channel
(
int
channel
)
{
if
(
!
channel
)
return
-
1
;
return
;
mpll_stop
(
&
softpll
.
aux
[
channel
-
1
]);
}
...
...
@@ -486,7 +486,7 @@ int spll_update_aux_clocks()
for
(
i
=
0
;
i
<
n_chan_out
-
1
;
i
++
)
{
struct
spll_aux_state
*
s
=
&
softpll
.
aux_fsm
[
i
];
volatile
struct
spll_aux_state
*
s
=
&
softpll
.
aux_fsm
[
i
];
if
((
!
(
occr_aux_en
&
(
1
<<
(
i
+
1
)))
&&
s
->
state
!=
AUX_DISABLED
))
{
...
...
softpll/spll_external.h
View file @
e0720653
...
...
@@ -55,7 +55,7 @@ struct spll_external_state {
spll_lock_det_t
ld
;
};
static
void
external_init
(
struct
spll_external_state
*
s
,
int
ext_ref
,
int
realign_clocks
)
static
void
external_init
(
volatile
struct
spll_external_state
*
s
,
int
ext_ref
,
int
realign_clocks
)
{
s
->
pi
.
y_min
=
5
;
...
...
@@ -78,10 +78,10 @@ static void external_init( struct spll_external_state *s, int ext_ref, int reali
s
->
realign_clocks
=
realign_clocks
;
s
->
realign_state
=
(
realign_clocks
?
REALIGN_STAGE1
:
REALIGN_DISABLED
);
pi_init
(
&
s
->
pi
);
ld_init
(
&
s
->
ld
);
lowpass_init
(
&
s
->
lp_short
,
4000
);
lowpass_init
(
&
s
->
lp_long
,
300
);
pi_init
(
(
spll_pi_t
*
)
&
s
->
pi
);
ld_init
(
(
spll_lock_det_t
*
)
&
s
->
ld
);
lowpass_init
(
(
spll_lowpass_t
*
)
&
s
->
lp_short
,
4000
);
lowpass_init
(
(
spll_lowpass_t
*
)
&
s
->
lp_long
,
300
);
}
static
inline
void
realign_fsm
(
struct
spll_external_state
*
s
)
...
...
softpll/spll_helper.h
View file @
e0720653
...
...
@@ -22,7 +22,7 @@ struct spll_helper_state {
spll_lock_det_t
ld
;
};
static
void
helper_init
(
struct
spll_helper_state
*
s
,
int
ref_channel
)
static
void
helper_init
(
volatile
struct
spll_helper_state
*
s
,
int
ref_channel
)
{
/* Phase branch PI controller */
...
...
@@ -41,7 +41,7 @@ static void helper_init(struct spll_helper_state *s, int ref_channel)
s
->
delock_count
=
0
;
}
static
int
helper_update
(
struct
spll_helper_state
*
s
,
int
tag
,
int
source
)
static
int
helper_update
(
volatile
struct
spll_helper_state
*
s
,
int
tag
,
int
source
)
{
int
err
,
y
;
...
...
@@ -78,14 +78,14 @@ static int helper_update(struct spll_helper_state *s, int tag, int source)
s
->
p_setpoint
+=
(
1
<<
HPLL_N
);
s
->
tag_d0
=
tag
;
y
=
pi_update
(
&
s
->
pi
,
err
);
y
=
pi_update
(
(
spll_pi_t
*
)
&
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
);
if
(
ld_update
(
&
s
->
ld
,
err
))
if
(
ld_update
(
(
spll_lock_det_t
*
)
&
s
->
ld
,
err
))
return
SPLL_LOCKED
;
}
return
SPLL_LOCKING
;
...
...
@@ -93,7 +93,7 @@ static int helper_update(struct spll_helper_state *s, int tag, int source)
static
void
helper_start
(
struct
spll_helper_state
*
s
)
static
void
helper_start
(
volatile
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. */
...
...
@@ -104,8 +104,8 @@ static void helper_start(struct spll_helper_state *s)
s
->
sample_n
=
0
;
s
->
tag_d0
=
-
1
;
pi_init
(
&
s
->
pi
);
ld_init
(
&
s
->
ld
);
pi_init
(
(
spll_pi_t
*
)
&
s
->
pi
);
ld_init
(
(
spll_lock_det_t
*
)
&
s
->
ld
);
spll_enable_tagger
(
s
->
ref_src
,
1
);
spll_debug
(
DBG_EVENT
|
DBG_HELPER
,
DBG_EVT_START
,
1
);
...
...
softpll/spll_main.h
View file @
e0720653
...
...
@@ -30,7 +30,7 @@ struct spll_main_state {
};
static
void
mpll_init
(
struct
spll_main_state
*
s
,
int
id_ref
,
int
id_out
)
static
void
mpll_init
(
volatile
struct
spll_main_state
*
s
,
int
id_ref
,
int
id_out
)
{
/* Frequency branch PI controller */
s
->
pi
.
y_min
=
5
;
...
...
@@ -49,11 +49,11 @@ static void mpll_init(struct spll_main_state *s, int id_ref, int id_out)
s
->
id_out
=
id_out
;
s
->
dac_index
=
id_out
-
n_chan_ref
;
pi_init
(
&
s
->
pi
);
ld_init
(
&
s
->
ld
);
pi_init
(
(
spll_pi_t
*
)
&
s
->
pi
);
ld_init
(
(
spll_lock_det_t
*
)
&
s
->
ld
);
}
static
void
mpll_start
(
struct
spll_main_state
*
s
)
static
void
mpll_start
(
volatile
struct
spll_main_state
*
s
)
{
s
->
adder_ref
=
s
->
adder_out
=
0
;
s
->
tag_ref
=
-
1
;
...
...
@@ -68,21 +68,21 @@ static void mpll_start(struct spll_main_state *s)
s
->
phase_shift_current
=
0
;
s
->
sample_n
=
0
;
pi_init
(
&
s
->
pi
);
ld_init
(
&
s
->
ld
);
pi_init
(
(
spll_pi_t
*
)
&
s
->
pi
);
ld_init
(
(
spll_lock_det_t
*
)
&
s
->
ld
);
spll_enable_tagger
(
s
->
id_ref
,
1
);
spll_enable_tagger
(
s
->
id_out
,
1
);
spll_debug
(
DBG_EVENT
|
DBG_MAIN
,
DBG_EVT_START
,
1
);
}
static
void
mpll_stop
(
struct
spll_main_state
*
s
)
static
void
mpll_stop
(
volatile
struct
spll_main_state
*
s
)
{
spll_enable_tagger
(
s
->
id_out
,
0
);
}
static
int
mpll_update
(
struct
spll_main_state
*
s
,
int
tag
,
int
source
)
static
int
mpll_update
(
volatile
struct
spll_main_state
*
s
,
int
tag
,
int
source
)
{
int
err
,
y
,
tmp
;
...
...
@@ -170,7 +170,7 @@ static int mpll_update(struct spll_main_state *s, int tag, int source)
#endif
y
=
pi_update
(
&
s
->
pi
,
err
);
y
=
pi_update
((
spll_pi_t
*
)
&
s
->
pi
,
err
);
SPLL
->
DAC_MAIN
=
SPLL_DAC_MAIN_VALUE_W
(
y
)
|
SPLL_DAC_MAIN_DAC_SEL_W
(
s
->
dac_index
);
spll_debug
(
DBG_MAIN
|
DBG_REF
,
s
->
tag_ref
+
s
->
adder_ref
,
0
);
...
...
@@ -182,7 +182,7 @@ static int mpll_update(struct spll_main_state *s, int tag, int source)
s
->
tag_out
=
-
1
;
s
->
tag_ref
=
-
1
;
if
(
s
->
adder_ref
>
2
*
MPLL_TAG_WRAPAROUND
&&
s
->
adder_out
>
2
*
MPLL_TAG_WRAPAROUND
)
if
(
s
->
adder_ref
>
2
*
MPLL_TAG_WRAPAROUND
&&
s
->
adder_out
>
2
*
MPLL_TAG_WRAPAROUND
)
{
s
->
adder_ref
-=
MPLL_TAG_WRAPAROUND
;
s
->
adder_out
-=
MPLL_TAG_WRAPAROUND
;
...
...
@@ -199,7 +199,7 @@ static int mpll_update(struct spll_main_state *s, int tag, int source)
s
->
adder_ref
--
;
}
}
if
(
ld_update
(
&
s
->
ld
,
err
))
if
(
ld_update
(
(
spll_lock_det_t
*
)
&
s
->
ld
,
err
))
return
SPLL_LOCKED
;
}
...
...
@@ -207,12 +207,12 @@ static int mpll_update(struct spll_main_state *s, int tag, int source)
return
SPLL_LOCKING
;
}
static
int
mpll_set_phase_shift
(
struct
spll_main_state
*
s
,
int
desired_shift
)
static
int
mpll_set_phase_shift
(
volatile
struct
spll_main_state
*
s
,
int
desired_shift
)
{
s
->
phase_shift_target
=
desired_shift
;
}
static
int
mpll_shifter_busy
(
struct
spll_main_state
*
s
)
static
int
mpll_shifter_busy
(
volatile
struct
spll_main_state
*
s
)
{
return
s
->
phase_shift_target
!=
s
->
phase_shift_current
;
}
softpll/spll_ptracker.h
View file @
e0720653
...
...
@@ -11,7 +11,7 @@ struct spll_ptracker_state {
};
static
void
ptracker_init
(
struct
spll_ptracker_state
*
s
,
int
id_a
,
int
id_b
,
int
num_avgs
)
static
void
ptracker_init
(
volatile
struct
spll_ptracker_state
*
s
,
int
id_a
,
int
id_b
,
int
num_avgs
)
{
s
->
tag_a
=
s
->
tag_b
=
-
1
;
...
...
@@ -25,7 +25,7 @@ static void ptracker_init(struct spll_ptracker_state *s, int id_a, int id_b, int
s
->
preserve_sign
=
0
;
}
static
void
ptracker_start
(
struct
spll_ptracker_state
*
s
)
static
void
ptracker_start
(
volatile
struct
spll_ptracker_state
*
s
)
{
s
->
tag_a
=
s
->
tag_b
=
-
1
;
s
->
ready
=
0
;
...
...
@@ -42,7 +42,7 @@ static void ptracker_start(struct spll_ptracker_state *s)
#define PTRACK_WRAP_LO (1<<(HPLL_N-2))
#define PTRACK_WRAP_HI (3*(1<<(HPLL_N-2)))
static
int
ptracker_update
(
struct
spll_ptracker_state
*
s
,
int
tag
,
int
source
)
static
int
ptracker_update
(
volatile
struct
spll_ptracker_state
*
s
,
int
tag
,
int
source
)
{
if
(
source
==
s
->
id_a
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment