Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
FMC TDC 1ns 5cha - Software
Commits
9d9fc227
Commit
9d9fc227
authored
Jan 20, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: fix print warnings
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
d36603aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
fmc-tdc-read.c
tools/fmc-tdc-read.c
+3
-2
fmc-tdc-tstamp.c
tools/fmc-tdc-tstamp.c
+3
-2
No files found.
tools/fmc-tdc-read.c
View file @
9d9fc227
...
...
@@ -11,19 +11,20 @@
* fmctdc-read: read timestamps from a given FmcTdc card.
*/
#include <inttypes.h>
#include "test-common.h"
void
dump_timestamp
(
struct
fmctdc_time
ts
,
int
channel
,
int
fmt_wr
)
{
if
(
fmt_wr
)
printf
(
"channel %d seq %-12u ts %10
llu
:%09u:%04u
\n
"
,
channel
,
printf
(
"channel %d seq %-12u ts %10
"
PRIu64
"
:%09u:%04u
\n
"
,
channel
,
ts
.
seq_id
,
ts
.
seconds
,
ts
.
coarse
,
ts
.
frac
);
else
{
uint64_t
picoseconds
=
(
uint64_t
)
ts
.
coarse
*
8000ULL
+
(
uint64_t
)
ts
.
frac
*
8000ULL
/
4096ULL
;
printf
(
"channel %d seq %-12u ts %10
llu
.%03llu,%03llu,%03llu,%03llu ps
\n
"
,
(
"channel %d seq %-12u ts %10
"
PRIu64
"
.%03llu,%03llu,%03llu,%03llu ps
\n
"
,
channel
,
ts
.
seq_id
,
ts
.
seconds
,
picoseconds
/
1000000000ULL
,
(
picoseconds
/
1000000ULL
)
%
1000ULL
,
...
...
tools/fmc-tdc-tstamp.c
View file @
9d9fc227
...
...
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <inttypes.h>
#include <getopt.h>
...
...
@@ -35,14 +36,14 @@ void dump_timestamp(struct fmctdc_time ts, int fmt_wr)
if
(
fmt_wr
)
{
/* White rabbit format */
fprintf
(
stdout
,
"%10
llu
:%09u:%04u"
,
fprintf
(
stdout
,
"%10
"
PRIu64
"
:%09u:%04u"
,
ts
.
seconds
,
ts
.
coarse
,
ts
.
frac
);
return
;
}
else
{
picoseconds
=
(
uint64_t
)
ts
.
coarse
*
8000ULL
+
(
uint64_t
)
ts
.
frac
*
8000ULL
/
4096ULL
;
fprintf
(
stdout
,
"%010
llu
.%03llu,%03llu,%03llu,%03llu ps"
,
"%010
"
PRIu64
"
.%03llu,%03llu,%03llu,%03llu ps"
,
ts
.
seconds
,
picoseconds
/
1000000000ULL
,
(
picoseconds
/
1000000ULL
)
%
1000ULL
,
...
...
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