Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Zynq Ultrascale-based System Board
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
DIOT Zynq Ultrascale-based System Board
Commits
a9dcef84
Commit
a9dcef84
authored
Nov 05, 2021
by
Adam Wujek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw/petalinux/diot-util: display clocks in MHz not Hz
Signed-off-by:
Adam Wujek
<
dev_public@wujek.eu
>
parent
32e229a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
diot_util_clk.c
...ec/meta-user/recipes-apps/diot-util/files/diot_util_clk.c
+13
-4
No files found.
sw/petalinux/project-spec/meta-user/recipes-apps/diot-util/files/diot_util_clk.c
View file @
a9dcef84
...
...
@@ -82,6 +82,15 @@ out:
return
ret
;
}
char
*
value_float_or_error
(
char
*
buff
,
int
ret
,
int
val
)
{
if
(
ret
<
0
)
return
"error"
;
sprintf
(
buff
,
"%.3f"
,
((
float
)
val
)
/
1000000
);
return
buff
;
}
char
*
value_or_error
(
char
*
buff
,
int
ret
,
int
val
)
{
if
(
ret
<
0
)
...
...
@@ -100,23 +109,23 @@ void print_clk_rate(void)
char
buff
[
20
];
printf
(
"-------+------------+
\n
"
);
printf
(
"clk |
Hz |
\n
"
);
printf
(
"clk |
M
Hz |
\n
"
);
printf
(
"-------+------------+
\n
"
);
snprintf
(
path_buff
,
sizeof
(
path_buff
),
"%s/clk_rate"
,
SI5341_PREFIX_PATH
);
ret
=
get_file_content
(
path_buff
,
&
val
);
printf
(
"InDiv | %10s |
\n
"
,
value_or_error
(
buff
,
ret
,
val
));
printf
(
"InDiv | %10s |
\n
"
,
value_
float_
or_error
(
buff
,
ret
,
val
));
snprintf
(
path_buff
,
sizeof
(
path_buff
),
"%s.N0/clk_rate"
,
SI5341_PREFIX_PATH
);
ret
=
get_file_content
(
path_buff
,
&
val
);
printf
(
"PLLout | %10s |
\n
"
,
value_or_error
(
buff
,
ret
,
val
));
printf
(
"PLLout | %10s |
\n
"
,
value_
float_
or_error
(
buff
,
ret
,
val
));
for
(
i
=
0
;
i
<
SI5341_N_CH_OUT
;
i
++
)
{
snprintf
(
path_buff
,
sizeof
(
path_buff
),
"%s.%d/clk_rate"
,
SI5341_PREFIX_PATH
,
i
);
ret
=
get_file_content
(
path_buff
,
&
val
);
printf
(
"Out%d | %10s |
\n
"
,
i
,
value_or_error
(
buff
,
ret
,
val
));
printf
(
"Out%d | %10s |
\n
"
,
i
,
value_
float_
or_error
(
buff
,
ret
,
val
));
}
printf
(
"-------+------------+
\n
"
);
...
...
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