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
7
Merge Requests
7
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
cbe72cab
Commit
cbe72cab
authored
Feb 01, 2017
by
Adam Wujek
💬
Committed by
Grzegorz Daniluk
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUG: 1360] monitor: show IP before lock
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
6b3848b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
106 deletions
+101
-106
monitor_ppsi.c
monitor/monitor_ppsi.c
+101
-106
No files found.
monitor/monitor_ppsi.c
View file @
cbe72cab
...
...
@@ -70,12 +70,12 @@ static int wrc_mon_status(void)
if
((
!
s
->
flags
&
WR_FLAG_VALID
)
||
(
ppi
->
state
!=
PPS_SLAVE
))
{
cprintf
(
C_RED
,
"
\n\n
Sync info not valid
\n
\n
"
);
"
\n\n
Sync info not valid
\n
"
);
return
0
;
}
/* show_servo */
cprintf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n
\n
"
);
cprintf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n
"
);
return
1
;
}
...
...
@@ -105,8 +105,8 @@ int wrc_mon_gui(void)
term_clear
();
pcprintf
(
1
,
1
,
C_BLUE
,
"WR PTP Core Sync Monitor v 1.0"
);
pcprintf
(
2
,
1
,
C_GREY
,
"
Esc = exit"
);
cprintf
(
C_BLUE
,
"WR PTP Core Sync Monitor v 1.0"
);
cprintf
(
C_GREY
,
"
\n
Esc = exit"
);
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
...
...
@@ -115,19 +115,44 @@ int wrc_mon_gui(void)
/*show_ports */
wrpc_get_port_state
(
&
state
,
NULL
);
pcprintf
(
4
,
1
,
C_BLUE
,
"
\n\n
Link status:"
);
cprintf
(
C_BLUE
,
"
\n\n
Link status:"
);
pcprintf
(
6
,
1
,
C_WHITE
,
"
%s: "
,
"wru1"
);
cprintf
(
C_WHITE
,
"
\n
%s: "
,
"wru1"
);
if
(
state
.
state
)
cprintf
(
C_GREEN
,
"Link up "
);
else
cprintf
(
C_RED
,
"Link down "
);
if
(
state
.
state
)
{
minic_get_stats
(
&
tx
,
&
rx
);
cprintf
(
C_GREY
,
"(RX: %d, TX: %d), mode: "
,
rx
,
tx
);
cprintf
(
C_GREY
,
"(RX: %d, TX: %d)"
,
rx
,
tx
);
if
(
!
state
.
state
)
{
return
1
;
}
if
(
HAS_IP
)
{
uint8_t
ip
[
4
];
cprintf
(
C_WHITE
,
" IPv4: "
);
getIP
(
ip
);
format_ip
(
buf
,
ip
);
switch
(
ip_status
)
{
case
IP_TRAINING
:
cprintf
(
C_RED
,
"BOOTP running"
);
break
;
case
IP_OK_BOOTP
:
cprintf
(
C_GREEN
,
"%s (from bootp)"
,
buf
);
break
;
case
IP_OK_STATIC
:
cprintf
(
C_GREEN
,
"%s (static assignment)"
,
buf
);
break
;
}
}
cprintf
(
C_GREY
,
"
\n
Mode: "
);
if
(
!
WR_DSPOR
(
ppi
)
->
wrModeOn
)
{
cprintf
(
C_RED
,
"WR Off"
);
wrc_mon_std_servo
();
return
1
;
}
...
...
@@ -149,28 +174,10 @@ int wrc_mon_gui(void)
else
cprintf
(
C_RED
,
"NoLock "
);
if
(
state
.
calib
.
rx_calibrated
&&
state
.
calib
.
tx_calibrated
)
cprintf
(
C_GREEN
,
"Calibrated
"
);
cprintf
(
C_GREEN
,
"Calibrated
"
);
else
cprintf
(
C_RED
,
"Uncalibrated
"
);
cprintf
(
C_RED
,
"Uncalibrated
"
);
if
(
HAS_IP
)
{
uint8_t
ip
[
4
];
cprintf
(
C_WHITE
,
"
\n
IPv4: "
);
getIP
(
ip
);
format_ip
(
buf
,
ip
);
switch
(
ip_status
)
{
case
IP_TRAINING
:
cprintf
(
C_RED
,
"BOOTP running"
);
break
;
case
IP_OK_BOOTP
:
cprintf
(
C_GREEN
,
"%s (from bootp)"
,
buf
);
break
;
case
IP_OK_STATIC
:
cprintf
(
C_GREEN
,
"%s (static assignment)"
,
buf
);
break
;
}
}
if
(
wrc_mon_status
()
==
0
)
return
1
;
...
...
@@ -196,7 +203,7 @@ int wrc_mon_gui(void)
cprintf
(
C_GREEN
,
", locked"
);
pp_printf
(
"
\n
"
);
cprintf
(
C_BLUE
,
"
\n
Timing parameters:
\n
\n
"
);
cprintf
(
C_BLUE
,
"
\n
Timing parameters:
\n
"
);
cprintf
(
C_GREY
,
"Round-trip time (mu): "
);
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
s
->
picos_mu
));
...
...
@@ -214,8 +221,7 @@ int wrc_mon_gui(void)
(
int32_t
)
s
->
delta_rx_s
);
total_asymmetry
=
s
->
picos_mu
-
2LL
*
s
->
delta_ms
;
cprintf
(
C_GREY
,
"Total link asymmetry: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
total_asymmetry
));
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
total_asymmetry
));
crtt
=
s
->
picos_mu
-
s
->
delta_tx_m
-
s
->
delta_rx_m
-
s
->
delta_tx_s
-
s
->
delta_rx_s
;
...
...
@@ -223,25 +229,16 @@ int wrc_mon_gui(void)
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
crtt
));
cprintf
(
C_GREY
,
"Clock offset: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
s
->
offset
));
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
s
->
offset
));
cprintf
(
C_GREY
,
"Phase setpoint: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
s
->
cur_setpoint
));
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
s
->
cur_setpoint
));
cprintf
(
C_GREY
,
"Skew: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
s
->
skew
));
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
s
->
skew
));
cprintf
(
C_GREY
,
"Update counter: "
);
cprintf
(
C_WHITE
,
"%9d
\n
"
,
(
int32_t
)
(
s
->
update_count
));
}
pp_printf
(
"--"
);
cprintf
(
C_WHITE
,
"%9d
\n
"
,
(
int32_t
)
(
s
->
update_count
));
return
1
;
}
...
...
@@ -264,12 +261,10 @@ static inline void cprintf_time(int color, struct pp_time *time)
static
void
wrc_mon_std_servo
(
void
)
{
cprintf
(
C_RED
,
"WR Off"
);
if
(
wrc_mon_status
()
==
0
)
return
;
cprintf
(
C_GREY
,
"Clock offset: "
);
cprintf
(
C_GREY
,
"
\n
Clock offset: "
);
if
(
DSCUR
(
ppi
)
->
offsetFromMaster
.
secs
)
cprintf_time
(
C_WHITE
,
&
DSCUR
(
ppi
)
->
offsetFromMaster
);
...
...
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