Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
7408338a
Commit
7408338a
authored
Apr 12, 2017
by
Alessandro Rubini
Committed by
Adam Wujek
Jun 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sofpll: simplify a string array (and shrink by 72 bytes)
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
098116fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
31 deletions
+18
-31
softpll_ng.c
softpll/softpll_ng.c
+18
-14
spll_common.c
softpll/spll_common.c
+0
-10
spll_common.h
softpll/spll_common.h
+0
-7
No files found.
softpll/softpll_ng.c
View file @
7408338a
...
...
@@ -37,20 +37,20 @@ int spll_n_chan_ref, spll_n_chan_out;
#define MAIN_CHANNEL (spll_n_chan_ref)
static
const
struct
stringlist_entry
seq_states
[]
=
{
{
SEQ_START_EXT
,
"start-ext"
},
{
SEQ_WAIT_EXT
,
"wait-ext"
},
{
SEQ_START_HELPER
,
"start-helper"
},
{
SEQ_WAIT_HELPER
,
"wait-helper"
},
{
SEQ_START_MAIN
,
"start-main"
},
{
SEQ_WAIT_MAIN
,
"wait-main"
},
{
SEQ_DISABLED
,
"disabled"
},
{
SEQ_READY
,
"ready"
},
{
SEQ_CLEAR_DACS
,
"clear-dacs"
},
{
SEQ_WAIT_CLEAR_DACS
,
"wait-clear-dacs"
},
{
0
,
NULL
}
static
const
char
*
seq_states
[]
=
{
[
SEQ_START_EXT
]
=
"start-ext"
,
[
SEQ_WAIT_EXT
]
=
"wait-ext"
,
[
SEQ_START_HELPER
]
=
"start-helper"
,
[
SEQ_WAIT_HELPER
]
=
"wait-helper"
,
[
SEQ_START_MAIN
]
=
"start-main"
,
[
SEQ_WAIT_MAIN
]
=
"wait-main"
,
[
SEQ_DISABLED
]
=
"disabled"
,
[
SEQ_READY
]
=
"ready"
,
[
SEQ_CLEAR_DACS
]
=
"clear-dacs"
,
[
SEQ_WAIT_CLEAR_DACS
]
=
"wait-clear-dacs"
,
};
#define SEQ_STATES_NR ARRAY_SIZE(seq_states)
volatile
struct
softpll_state
softpll
;
...
...
@@ -481,11 +481,15 @@ void spll_get_num_channels(int *n_ref, int *n_out)
void
spll_show_stats
()
{
struct
softpll_state
*
s
=
(
struct
softpll_state
*
)
&
softpll
;
const
char
*
statename
=
seq_states
[
s
->
seq_state
];
if
(
s
->
seq_state
>=
SEQ_STATES_NR
)
statename
=
"<Unknown>"
;
if
(
softpll
.
mode
>
0
)
pp_printf
(
"softpll: irqs %d seq %s mode %d "
"alignment_state %d HL%d ML%d HY=%d MY=%d DelCnt=%d
\n
"
,
s
->
irq_count
,
st
ringlist_lookup
(
seq_states
,
s
->
seq_state
)
,
s
->
irq_count
,
st
atename
,
s
->
mode
,
s
->
ext
.
align_state
,
s
->
helper
.
ld
.
locked
,
s
->
mpll
.
ld
.
locked
,
s
->
helper
.
pi
.
y
,
s
->
mpll
.
pi
.
y
,
...
...
softpll/spll_common.c
View file @
7408338a
...
...
@@ -124,13 +124,3 @@ void spll_enable_tagger(int channel, int enable)
pll_verbose
(
"%s: ch %d, OCER 0x%x, RCER 0x%x
\n
"
,
__FUNCTION__
,
channel
,
SPLL
->
OCER
,
SPLL
->
RCER
);
}
const
char
*
stringlist_lookup
(
const
struct
stringlist_entry
*
slist
,
int
id
)
{
int
i
;
for
(
i
=
0
;
slist
[
i
].
str
;
i
++
)
{
if
(
slist
[
i
].
id
==
id
)
return
slist
[
i
].
str
;
}
return
"<unknown>"
;
}
softpll/spll_common.h
View file @
7408338a
...
...
@@ -50,11 +50,6 @@ typedef struct {
int
lock_changed
;
}
spll_lock_det_t
;
struct
stringlist_entry
{
int
id
;
const
char
*
str
;
};
/* initializes the PI controller state. Currently almost a stub. */
void
pi_init
(
spll_pi_t
*
pi
);
...
...
@@ -67,6 +62,4 @@ int ld_update(spll_lock_det_t *ld, int y);
void
spll_enable_tagger
(
int
channel
,
int
enable
);
const
char
*
stringlist_lookup
(
const
struct
stringlist_entry
*
slist
,
int
id
);
#endif // __SPLL_COMMON_H
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