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
fc3d1bdd
Commit
fc3d1bdd
authored
Sep 07, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: keep last TS locally in the function
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
91411cac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
fmc-tdc-tstamp.c
tools/fmc-tdc-tstamp.c
+10
-5
No files found.
tools/fmc-tdc-tstamp.c
View file @
fc3d1bdd
...
...
@@ -26,7 +26,6 @@
char
git_version
[]
=
"git_version: "
GIT_VERSION
;
/* Previous time stamp for each channel */
struct
fmctdc_time
ts_prev
[
FMCTDC_NUM_CHANNELS
];
static
unsigned
int
stop
=
0
,
fmt_wr
=
0
;
enum
tstamp_print_format
{
...
...
@@ -86,6 +85,11 @@ static void print_ts(struct fmctdc_time ts, enum tstamp_print_format fmt)
void
dump
(
unsigned
int
ch
,
struct
fmctdc_time
*
ts
,
int
diff_mode
)
{
static
struct
fmctdc_time
ts_prev_lst
[
FMCTDC_NUM_CHANNELS
]
=
{{
0
,
0
,
0
,
-
1
,
0
},
{
0
,
0
,
0
,
-
1
,
0
},
{
0
,
0
,
0
,
-
1
,
0
},
{
0
,
0
,
0
,
-
1
,
0
},
{
0
,
0
,
0
,
-
1
,
0
}};
struct
fmctdc_time
ts_tmp
;
uint64_t
ns
;
double
s
,
hz
;
...
...
@@ -96,9 +100,6 @@ void dump(unsigned int ch, struct fmctdc_time *ts, int diff_mode)
print_ts
(
*
ts
,
fmt_wr
);
fprintf
(
stdout
,
"
\n
"
);
ts_tmp
=
*
ts
;
fmctdc_ts_sub
(
&
ts_tmp
,
&
ts_prev
[
ch
]);
if
(
diff_mode
)
{
fprintf
(
stdout
,
" refer to board seq %-12u
\n
"
,
ts
->
ref_gseq_id
);
...
...
@@ -106,6 +107,9 @@ void dump(unsigned int ch, struct fmctdc_time *ts, int diff_mode)
}
/* We are in normal mode, calculate the difference */
ts_tmp
=
*
ts
;
fmctdc_ts_sub
(
&
ts_tmp
,
&
ts_prev_lst
[
ch
]);
fprintf
(
stdout
,
" diff "
);
print_ts
(
ts_tmp
,
fmt_wr
);
...
...
@@ -114,6 +118,8 @@ void dump(unsigned int ch, struct fmctdc_time *ts, int diff_mode)
s
=
ts_tmp
.
seconds
+
((
double
)
ns
/
1000000000ULL
);
hz
=
1
/
s
;
fprintf
(
stdout
,
" [%f Hz]
\n
"
,
hz
);
ts_prev_lst
[
ch
]
=
*
ts
;
}
/* We could use print_version from test-common.c, but to avoid creating
...
...
@@ -521,7 +527,6 @@ int main(int argc, char **argv)
if
(
n
%
n_show
==
0
)
dump
(
i
,
&
ts
[
0
],
ref
[
i
]
<
0
?
0
:
1
);
ts_prev
[
i
]
=
ts
[
n_ts
-
1
];
n
+=
n_ts
;
}
}
...
...
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