Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
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
White Rabbit Switch - Software
Commits
6f3298e0
Commit
6f3298e0
authored
Feb 17, 2017
by
Benoit Rat
Committed by
Adam Wujek
Aug 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/tools: update webinterface output for wr_mon
parent
9f585478
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
17 deletions
+36
-17
wr_mon.c
userspace/tools/wr_mon.c
+36
-17
No files found.
userspace/tools/wr_mon.c
View file @
6f3298e0
...
...
@@ -494,14 +494,33 @@ void show_ports(int alive)
}
term_cprintf
(
C_WHITE
,
"
\n
"
);
}
else
if
(
mode
&
WEB_INTERFACE
)
{
printf
(
"%-5s "
,
if_name
);
printf
(
"%s "
,
state_up
(
port_state
->
state
)
?
"up"
:
"down"
);
printf
(
"%s "
,
if_mode
);
printf
(
"%s "
,
port_state
->
locked
?
"Locked"
:
"NoLock"
);
printf
(
"%s
\n
"
,
port_state
->
calib
.
rx_calibrated
printf
(
"%s
"
,
port_state
->
calib
.
rx_calibrated
&&
port_state
->
calib
.
tx_calibrated
?
"Calibrated"
:
"Uncalibrated"
);
for
(
j
=
0
;
j
<
ppg
->
nlinks
;
j
++
)
{
if
(
strcmp
(
if_name
,
pp_array
[
j
].
cfg
.
iface_name
)
)
{
/* Instance not for this interface
* skip */
continue
;
}
if
(
state_up
(
port_state
->
state
))
{
unsigned
char
*
p
=
pp_array
[
j
].
peer
;
printf
(
"%02x:%02x:%02x:%02x:%02x:%02x"
" "
,
p
[
0
],
p
[
1
],
p
[
2
],
p
[
3
],
p
[
4
],
p
[
5
]);
}
}
printf
(
"
\n
"
);
}
else
if
(
print_port
)
{
printf
(
"port:%s "
,
if_name
);
printf
(
"lnk:%d "
,
state_up
(
port_state
->
state
));
...
...
@@ -648,18 +667,15 @@ void show_servo(int alive)
/* SPEC shows temperature, but that can be selected separately
* in this program
*/
if
(
mode
==
WEB_INTERFACE
)
printf
(
"
\n
"
);
}
}
void
show_temperatures
(
void
)
{
if
((
mode
==
SHOW_GUI
)
||
(
mode
&
WEB_INTERFACE
))
{
if
(
mode
==
SHOW_GUI
)
{
/* -------------------------------------------------------------------------------*/
term_cprintf
(
C_CYAN
,
"
\n
-------------------------------- Temperatures ---------------------------------
\n
"
);
}
else
{
term_cprintf
(
C_CYAN
,
"
\n
Temperatures:
\n
"
);
}
if
((
mode
==
SHOW_GUI
))
{
term_cprintf
(
C_CYAN
,
"
\n
-------------------------------- Temperatures ---------------------------------
\n
"
);
term_cprintf
(
C_BLUE
,
"FPGA: "
);
term_cprintf
(
C_WHITE
,
"%2.2f "
,
...
...
@@ -679,12 +695,16 @@ void show_temperatures(void)
printf
(
"pll:%2.2f "
,
temp_sensors_local
.
pll
/
256
.
0
);
printf
(
"psl:%2.2f "
,
temp_sensors_local
.
psl
/
256
.
0
);
printf
(
"psr:%2.2f"
,
temp_sensors_local
.
psr
/
256
.
0
);
if
(
mode
==
WEB_INTERFACE
)
printf
(
"
\n
"
);
}
}
void
show_time
(
void
)
{
printf
(
"TIME sec:%lld nsec:%d "
,
seconds
,
nanoseconds
);
if
(
mode
==
WEB_INTERFACE
)
printf
(
"
\n
"
);
}
void
show_all
(
void
)
...
...
@@ -704,7 +724,7 @@ void show_all(void)
ppsi_alive
=
(
ppsi_head
->
pid
&&
(
kill
(
ppsi_head
->
pid
,
0
)
==
0
))
+
ignore_alive
;
if
(
mode
&
SHOW_WR_TIME
)
{
if
(
mode
&
(
SHOW_WR_TIME
|
WEB_INTERFACE
)
)
{
if
(
ppsi_alive
)
show_time
();
else
if
(
mode
==
SHOW_ALL
)
...
...
@@ -715,7 +735,7 @@ void show_all(void)
show_ports
(
hal_alive
);
}
if
(
mode
&
SHOW_SERVO
||
mode
==
SHOW_GUI
)
{
if
(
mode
&
(
SHOW_SERVO
|
WEB_INTERFACE
)
||
mode
==
SHOW_GUI
)
{
show_servo
(
ppsi_alive
);
}
...
...
@@ -789,7 +809,13 @@ int main(int argc, char *argv[])
init_shm
();
if
(
shw_fpga_mmap_init
()
<
0
)
{
pr_error
(
"Can't initialize FPGA mmap
\n
"
);
exit
(
1
);
}
if
(
mode
&
WEB_INTERFACE
)
{
shw_pps_gen_read_time
(
&
seconds
,
&
nanoseconds
);
read_servo
();
read_hal
();
show_all
();
...
...
@@ -797,12 +823,6 @@ int main(int argc, char *argv[])
}
term_init
(
usecolor
);
if
(
shw_fpga_mmap_init
()
<
0
)
{
pr_error
(
"Can't initialize FPGA mmap
\n
"
);
exit
(
1
);
}
setvbuf
(
stdout
,
NULL
,
_IOFBF
,
4096
);
/* main loop */
...
...
@@ -832,7 +852,6 @@ int main(int argc, char *argv[])
if
(
seconds
!=
last_seconds
)
{
read_servo
();
read_hal
();
show_all
();
last_seconds
=
seconds
;
...
...
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