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
29
Issues
29
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
5ee623ef
Commit
5ee623ef
authored
May 21, 2012
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3-switch-for-wrpc-tom' into v3-switch_for_wrpc
Conflicts: dev/softpll_ng.c wrc_main.c
parents
135809f9
57b66dfc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
14 deletions
+71
-14
softpll_ng.c
dev/softpll_ng.c
+13
-1
monitor.c
monitor/monitor.c
+42
-0
wrc_main.c
wrc_main.c
+16
-13
No files found.
dev/softpll_ng.c
View file @
5ee623ef
...
...
@@ -535,8 +535,9 @@ int spll_update_aux_clocks()
break
;
case
AUX_READY
:
if
(
!
softpll
.
mpll
.
ld
.
locked
)
if
(
!
softpll
.
mpll
.
ld
.
locked
||
!
softpll
.
aux
[
i
].
ld
.
locked
)
{
TRACE
(
"[aux] aux channel or mpll lost lock
\n
"
);
SPLL
->
OCCR
&=
~
(
SPLL_OCCR_OUT_LOCK_W
((
1
<<
(
i
+
1
))));
s
->
state
=
AUX_DISABLED
;
}
...
...
@@ -557,3 +558,14 @@ int spll_get_aux_status(int channel)
return
rval
;
}
int
spll_get_dac
(
int
index
)
{
if
(
index
<
0
)
return
softpll
.
helper
.
pi
.
y
;
else
if
(
index
==
0
)
return
softpll
.
mpll
.
pi
.
y
;
else
if
(
index
>
0
)
return
softpll
.
aux
[
index
-
1
].
pi
.
y
;
return
0
;
}
monitor/monitor.c
View file @
5ee623ef
...
...
@@ -108,3 +108,45 @@ int wrc_mon_gui(void)
return
0
;
}
int
wrc_log_stats
(
void
)
{
static
char
*
slave_states
[]
=
{
"Uninitialized"
,
"SYNC_UTC"
,
"SYNC_NSEC"
,
"SYNC_PHASE"
,
"TRACK_PHASE"
};
static
uint32_t
last
=
0
;
hexp_port_state_t
ps
;
int
tx
,
rx
;
int
aux_stat
;
if
(
timer_get_tics
()
-
last
<
1000
)
return
0
;
last
=
timer_get_tics
();
halexp_get_port_state
(
&
ps
,
NULL
);
minic_get_stats
(
&
tx
,
&
rx
);
mprintf
(
"-->STAT Link:%d rx:%d tx:%d "
,
ps
.
up
,
rx
,
tx
);
mprintf
(
"Lock:%d "
,
ps
.
is_locked
?
1
:
0
);
mprintf
(
"ServoValid:%d "
,
cur_servo_state
.
valid
?
1
:
0
);
mprintf
(
"ServoState:'%s' "
,
cur_servo_state
.
slave_servo_state
);
aux_stat
=
spll_get_aux_status
(
0
);
mprintf
(
"aux:%x "
,
aux_stat
);
mprintf
(
"mu:%d "
,
cur_servo_state
.
mu
);
mprintf
(
"dms:%d "
,
cur_servo_state
.
delay_ms
);
mprintf
(
"dtxm:%d drxm:%d "
,
(
int32_t
)
cur_servo_state
.
delta_tx_m
,
(
int32_t
)
cur_servo_state
.
delta_rx_m
);
mprintf
(
"dtxs:%d drxs:%d "
,
(
int32_t
)
cur_servo_state
.
delta_tx_s
,
(
int32_t
)
cur_servo_state
.
delta_rx_s
);
mprintf
(
"asym:%d "
,
(
int32_t
)(
cur_servo_state
.
total_asymmetry
));
mprintf
(
"cable_rtt:%d "
,
(
int32_t
)(
cur_servo_state
.
mu
)
-
(
int32_t
)
cur_servo_state
.
delta_tx_m
-
(
int32_t
)
cur_servo_state
.
delta_rx_m
-
(
int32_t
)
cur_servo_state
.
delta_tx_s
-
(
int32_t
)
cur_servo_state
.
delta_rx_s
);
mprintf
(
"ckoffs:%d "
,
(
int32_t
)(
cur_servo_state
.
cur_offset
));
mprintf
(
"setpoint:%d "
,
(
int32_t
)(
cur_servo_state
.
cur_setpoint
));
mprintf
(
"HDAC:%d MDAC:%d ADAC:%d "
,
spll_get_dac
(
-
1
),
spll_get_dac
(
0
),
spll_get_dac
(
1
)
);
mprintf
(
"
\n
"
);
return
0
;
}
wrc_main.c
View file @
5ee623ef
...
...
@@ -207,11 +207,10 @@ void wrc_initialize()
uart_init
();
timer_init
(
1
);
// uart_write_string(__FILE__ " is up (compiled on "
// __DATE__ " " __TIME__ ")\n");
mprintf
(
"wr_core: starting up (press G to launch the GUI and D for extra debug messages)....
\n
"
);
uart_write_string
(
__FILE__
" is up (compiled on "
__DATE__
" "
__TIME__
")
\n
"
);
mprintf
(
"wr_core: starting up (press G to launch the GUI and D for extra debug messages)....
\n
"
);
//SFP
#if 1
if
(
get_sfp_id
(
sfp_pn
)
>=
0
)
...
...
@@ -298,8 +297,8 @@ int wrc_check_link()
return
rv
;
}
int
wrc_extra_debug
=
1
;
int
wrc_gui_mode
=
0
;
int
wrc_extra_debug
=
0
;
int
wrc_gui_mode
=
1
;
void
wrc_debug_printf
(
int
subsys
,
const
char
*
fmt
,
...)
{
...
...
@@ -361,18 +360,22 @@ void wrc_handle_input()
extern
volatile
int
irq_cnt
;
int
main
(
void
)
{
wrc_initialize
();
wrc_extra_debug
=
1
;
wrc_gui_mode
=
0
;
spll_init
(
SPLL_MODE_FREE_RUNNING_MASTER
,
0
,
1
);
for
(;;)
{
wrc_handle_input
();
if
(
wrc_gui_mode
)
wrc_mon_gui
();
for
(;;)
{
wrc_handle_input
();
if
(
wrc_gui_mode
)
wrc_mon_gui
();
else
wrc_log_stats
();
int
l_status
=
wrc_check_link
();
...
...
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