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
96c787d8
Commit
96c787d8
authored
Nov 21, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui output: better alignment of values
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
68baa53f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
util.c
lib/util.c
+5
-5
monitor.c
monitor/monitor.c
+20
-20
No files found.
lib/util.c
View file @
96c787d8
...
...
@@ -71,7 +71,7 @@ char *format_time(uint64_t sec)
t
.
tm_mday
=
dayno
+
1
;
t
.
tm_isdst
=
0
;
sprintf
(
buf
,
"%s, %s %d, %d, %
2d:%2d:%
2d"
,
_days
[
t
.
tm_wday
],
sprintf
(
buf
,
"%s, %s %d, %d, %
02d:%02d:%0
2d"
,
_days
[
t
.
tm_wday
],
_months
[
t
.
tm_mon
],
t
.
tm_mday
,
t
.
tm_year
+
YEAR0
,
t
.
tm_hour
,
t
.
tm_min
,
t
.
tm_sec
);
...
...
@@ -81,7 +81,7 @@ char *format_time(uint64_t sec)
void
cprintf
(
int
color
,
const
char
*
fmt
,
...)
{
va_list
ap
;
mprintf
(
"
\
033
[0%d;3%dm"
,
color
&
C_DIM
?
2
:
1
,
color
&
0x7f
);
mprintf
(
"\
e
[0%d;3%dm"
,
color
&
C_DIM
?
2
:
1
,
color
&
0x7f
);
va_start
(
ap
,
fmt
);
vprintf
(
fmt
,
ap
);
va_end
(
ap
);
...
...
@@ -90,8 +90,8 @@ void cprintf(int color, const char *fmt, ...)
void
pcprintf
(
int
row
,
int
col
,
int
color
,
const
char
*
fmt
,
...)
{
va_list
ap
;
mprintf
(
"
\
033
[%d;%df"
,
row
,
col
);
mprintf
(
"
\
033
[0%d;3%dm"
,
color
&
C_DIM
?
2
:
1
,
color
&
0x7f
);
mprintf
(
"\
e
[%d;%df"
,
row
,
col
);
mprintf
(
"\
e
[0%d;3%dm"
,
color
&
C_DIM
?
2
:
1
,
color
&
0x7f
);
va_start
(
ap
,
fmt
);
vprintf
(
fmt
,
ap
);
va_end
(
ap
);
...
...
@@ -99,5 +99,5 @@ void pcprintf(int row, int col, int color, const char *fmt, ...)
void
term_clear
()
{
mprintf
(
"
\
033
[2J
\033
[1;1H"
);
mprintf
(
"\
e[2J\e
[1;1H"
);
}
monitor/monitor.c
View file @
96c787d8
...
...
@@ -113,43 +113,43 @@ void wrc_mon_gui(void)
cprintf
(
C_BLUE
,
"
\n
Timing parameters:
\n\n
"
);
cprintf
(
C_GREY
,
"Round-trip time (mu):
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
mu
));
cprintf
(
C_GREY
,
"Master-slave delay:
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
cprintf
(
C_GREY
,
"Round-trip time (mu): "
);
cprintf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
mu
));
cprintf
(
C_GREY
,
"Master-slave delay: "
);
cprintf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
delay_ms
));
cprintf
(
C_GREY
,
"Master PHY delays:
"
);
cprintf
(
C_GREY
,
"Master PHY delays: "
);
cprintf
(
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
);
cprintf
(
C_GREY
,
"Slave PHY delays:
"
);
cprintf
(
C_GREY
,
"Slave PHY delays: "
);
cprintf
(
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
);
cprintf
(
C_GREY
,
"Total link asymmetry:
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
cprintf
(
C_GREY
,
"Total link asymmetry: "
);
cprintf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
total_asymmetry
));
cprintf
(
C_GREY
,
"Cable rtt delay:
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
cprintf
(
C_GREY
,
"Cable rtt delay: "
);
cprintf
(
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
);
cprintf
(
C_GREY
,
"Clock offset:
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
cprintf
(
C_GREY
,
"Clock offset: "
);
cprintf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
cur_offset
));
cprintf
(
C_GREY
,
"Phase setpoint:
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
cprintf
(
C_GREY
,
"Phase setpoint: "
);
cprintf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
cur_setpoint
));
cprintf
(
C_GREY
,
"Skew:
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
cprintf
(
C_GREY
,
"Skew: "
);
cprintf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
cur_servo_state
.
cur_skew
));
cprintf
(
C_GREY
,
"Manual phase adjustment:
"
);
cprintf
(
C_WHITE
,
"%d ps
\n
"
,
(
int32_t
)
(
wrc_man_phase
));
cprintf
(
C_GREY
,
"Manual phase adjustment: "
);
cprintf
(
C_WHITE
,
"%
9
d ps
\n
"
,
(
int32_t
)
(
wrc_man_phase
));
cprintf
(
C_GREY
,
"Update counter:
"
);
cprintf
(
C_WHITE
,
"%d
\n
"
,
cprintf
(
C_GREY
,
"Update counter: "
);
cprintf
(
C_WHITE
,
"%
9
d
\n
"
,
(
int32_t
)
(
cur_servo_state
.
update_count
));
}
...
...
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