Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wrpc-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
hdl-core-lib
wr-cores
wrpc-sw
Commits
ac6387af
Commit
ac6387af
authored
12 years ago
by
Aurelio Colosimo
Committed by
Alessandro Rubini
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
monitor/monitor_ppsi.c: restored color in gui
Signed-off-by:
Aurelio Colosimo
<
aurelio@aureliocolosimo.it
>
parent
fe7bf15d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
monitor/monitor_ppsi.c
+53
-51
53 additions, 51 deletions
monitor/monitor_ppsi.c
with
53 additions
and
51 deletions
monitor/monitor_ppsi.c
+
53
−
51
View file @
ac6387af
...
...
@@ -40,116 +40,118 @@ void wrc_mon_gui(void)
last
=
timer_get_tics
();
term_clear
();
pp_printf
(
"WR PTP Core Sync Monitor v 1.0"
);
pp_printf
(
"Esc = exit"
);
pcprintf
(
1
,
1
,
C_BLUE
,
"WR PTP Core Sync Monitor v 1.0"
);
pcprintf
(
2
,
1
,
C_GREY
,
"Esc = exit"
);
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
pp_
printf
(
"
\n\n
TAI Time: "
);
pp_
printf
(
"%s"
,
format_time
(
sec
));
c
printf
(
C_BLUE
,
"
\n\n
TAI Time: "
);
c
printf
(
C_WHITE
,
"%s"
,
format_time
(
sec
));
/*show_ports */
halexp_get_port_state
(
&
ps
,
NULL
);
p
p_
printf
(
"
\n\n
Link status:"
);
p
c
printf
(
4
,
1
,
C_BLUE
,
"
\n\n
Link status:"
);
p
p_
printf
(
"%s: "
,
"wru1"
);
p
c
printf
(
6
,
1
,
C_WHITE
,
"%s: "
,
"wru1"
);
if
(
ps
.
up
)
pp_
printf
(
"Link up "
);
c
printf
(
C_GREEN
,
"Link up "
);
else
pp_
printf
(
"Link down "
);
c
printf
(
C_RED
,
"Link down "
);
if
(
ps
.
up
)
{
minic_get_stats
(
&
tx
,
&
rx
);
pp_
printf
(
"(RX: %d, TX: %d), mode: "
,
rx
,
tx
);
c
printf
(
C_GREY
,
"(RX: %d, TX: %d), mode: "
,
rx
,
tx
);
/* FIXME: define HEXP_PORT_MODE_WR_MASTER/SLAVE somewhere
switch (ps.mode) {
case HEXP_PORT_MODE_WR_MASTER:
pp_
printf("WR Master ");
c
printf(
C_WHITE,
"WR Master ");
break;
case HEXP_PORT_MODE_WR_SLAVE:
pp_
printf("WR Slave ");
c
printf(
C_WHITE,
"WR Slave ");
break;
}
*/
if
(
ps
.
is_locked
)
pp_
printf
(
"Locked "
);
c
printf
(
C_GREEN
,
"Locked "
);
else
pp_
printf
(
"NoLock "
);
c
printf
(
C_RED
,
"NoLock "
);
if
(
ps
.
rx_calibrated
&&
ps
.
tx_calibrated
)
pp_
printf
(
"Calibrated "
);
c
printf
(
C_GREEN
,
"Calibrated "
);
else
pp_
printf
(
"Uncalibrated "
);
c
printf
(
C_RED
,
"Uncalibrated "
);
/* show_servo */
pp_
printf
(
"
\n\n
Synchronization status:
\n\n
"
);
c
printf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n\n
"
);
if
(
!
cur_servo_state
.
valid
)
{
pp_printf
(
"Master mode or sync info not valid
\n\n
"
);
cprintf
(
C_RED
,
"Master mode or sync info not valid
\n\n
"
);
return
;
}
pp_
printf
(
"Servo state: "
);
pp_
printf
(
"%s
\n
"
,
cur_servo_state
.
slave_servo_state
);
pp_
printf
(
"Phase tracking: "
);
c
printf
(
C_GREY
,
"Servo state: "
);
c
printf
(
C_WHITE
,
"%s
\n
"
,
cur_servo_state
.
slave_servo_state
);
c
printf
(
C_GREY
,
"Phase tracking: "
);
if
(
cur_servo_state
.
tracking_enabled
)
pp_
printf
(
"ON
\n
"
);
c
printf
(
C_GREEN
,
"ON
\n
"
);
else
pp_
printf
(
"OFF
\n
"
);
pp_
printf
(
"Synchronization source: "
);
pp_
printf
(
"%s
\n
"
,
cur_servo_state
.
sync_source
);
c
printf
(
C_RED
,
"OFF
\n
"
);
c
printf
(
C_GREY
,
"Synchronization source: "
);
c
printf
(
C_WHITE
,
"%s
\n
"
,
cur_servo_state
.
sync_source
);
pp_
printf
(
"Aux clock status: "
);
c
printf
(
C_GREY
,
"Aux clock status: "
);
aux_stat
=
spll_get_aux_status
(
0
);
if
(
aux_stat
&
SPLL_AUX_ENABLED
)
pp_
printf
(
"enabled"
);
c
printf
(
C_GREEN
,
"enabled"
);
if
(
aux_stat
&
SPLL_AUX_LOCKED
)
pp_
printf
(
", locked"
);
pp_
printf
(
"
\n
"
);
c
printf
(
C_GREEN
,
", locked"
);
m
printf
(
"
\n
"
);
pp_
printf
(
"
\n
Timing parameters:
\n\n
"
);
c
printf
(
C_BLUE
,
"
\n
Timing parameters:
\n\n
"
);
pp_
printf
(
"Round-trip time (mu):
"
);
pp_
printf
(
"%d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
mu
));
pp_
printf
(
"Master-slave delay:
"
);
pp_
printf
(
"%d ps
\n
"
,
c
printf
(
C_GREY
,
"Round-trip time (mu): "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
mu
));
c
printf
(
C_GREY
,
"Master-slave delay: "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
delay_ms
));
pp_
printf
(
"Master PHY delays:
"
);
pp_
printf
(
"TX: %d ps, RX: %d ps
\n
"
,
c
printf
(
C_GREY
,
"Master PHY delays: "
);
c
printf
(
C_WHITE
,
"TX: %d ps, RX: %d ps
\n
"
,
(
int32_t
)
cur_servo_state
.
delta_tx_m
,
(
int32_t
)
cur_servo_state
.
delta_rx_m
);
pp_
printf
(
"Slave PHY delays:
"
);
pp_
printf
(
"TX: %d ps, RX: %d ps
\n
"
,
c
printf
(
C_GREY
,
"Slave PHY delays: "
);
c
printf
(
C_WHITE
,
"TX: %d ps, RX: %d ps
\n
"
,
(
int32_t
)
cur_servo_state
.
delta_tx_s
,
(
int32_t
)
cur_servo_state
.
delta_rx_s
);
pp_
printf
(
"Total link asymmetry:
"
);
pp_
printf
(
"%d ps
\n
"
,
c
printf
(
C_GREY
,
"Total link asymmetry: "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
total_asymmetry
));
pp_
printf
(
"Cable rtt delay:
"
);
pp_
printf
(
"%d ps
\n
"
,
c
printf
(
C_GREY
,
"Cable rtt delay: "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
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
);
pp_
printf
(
"Clock offset:
"
);
pp_
printf
(
"%d ps
\n
"
,
c
printf
(
C_GREY
,
"Clock offset: "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
cur_offset
));
pp_
printf
(
"Phase setpoint:
"
);
pp_
printf
(
"%d ps
\n
"
,
c
printf
(
C_GREY
,
"Phase setpoint: "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
cur_setpoint
));
pp_
printf
(
"Skew:
"
);
pp_
printf
(
"%d ps
\n
"
,
c
printf
(
C_GREY
,
"Skew: "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
cur_skew
));
pp_
printf
(
"Manual phase adjustment:
"
);
pp_
printf
(
"%d ps
\n
"
,
(
int32_t
)
(
wrc_man_phase
));
c
printf
(
C_GREY
,
"Manual phase adjustment: "
);
c
printf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
wrc_man_phase
));
pp_
printf
(
"Update counter:
"
);
pp_
printf
(
"%d
\n
"
,
c
printf
(
C_GREY
,
"Update counter: "
);
c
printf
(
C_WHITE
,
"%
9
d
\n
"
,
(
int32_t
)
(
cur_servo_state
.
update_count
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment