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
146d18ad
Commit
146d18ad
authored
Jul 22, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: fmt_wr is a global variable now
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
6d0e56cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
fmc-tdc-tstamp.c
tools/fmc-tdc-tstamp.c
+7
-7
No files found.
tools/fmc-tdc-tstamp.c
View file @
146d18ad
...
...
@@ -29,10 +29,10 @@
/* Previous time stamp for each channel */
struct
fmctdc_time
ts_prev
[
FMCTDC_NUM_CHANNELS
];
static
unsigned
int
stop
=
0
;
static
unsigned
int
stop
=
0
,
fmt_wr
=
0
;
void
dump_timestamp
(
struct
fmctdc_time
ts
,
int
fmt_wr
)
void
dump_timestamp
(
struct
fmctdc_time
ts
)
{
uint64_t
picoseconds
;
...
...
@@ -50,7 +50,7 @@ void dump_timestamp(struct fmctdc_time ts, int fmt_wr)
}
}
void
dump
(
unsigned
int
ch
,
struct
fmctdc_time
*
ts
,
int
fmt_wr
,
int
diff_mode
)
void
dump
(
unsigned
int
ch
,
struct
fmctdc_time
*
ts
,
int
diff_mode
)
{
struct
fmctdc_time
ts_tmp
;
uint64_t
ns
;
...
...
@@ -58,7 +58,7 @@ void dump(unsigned int ch, struct fmctdc_time *ts, int fmt_wr, int diff_mode)
fprintf
(
stdout
,
"channel %d | channel seq %-12u | board seq %-12u
\n
ts "
,
ch
,
ts
->
seq_id
,
ts
->
gseq_id
);
dump_timestamp
(
*
ts
,
fmt_wr
);
dump_timestamp
(
*
ts
);
fprintf
(
stdout
,
"
\n
"
);
ts_tmp
=
*
ts
;
...
...
@@ -71,7 +71,7 @@ void dump(unsigned int ch, struct fmctdc_time *ts, int fmt_wr, int diff_mode)
/* We are in normal mode, calculate the difference */
fprintf
(
stdout
,
" diff "
);
dump_timestamp
(
ts_tmp
,
fmt_wr
);
dump_timestamp
(
ts_tmp
);
ns
=
(
uint64_t
)
ts_tmp
.
coarse
*
8ULL
;
ns
+=
(
uint64_t
)
(
ts_tmp
.
frac
*
8000ULL
/
4096ULL
)
/
1000ULL
;
...
...
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
int
nblock
=
0
,
buflen
=
16
;
enum
fmctdc_buffer_mode
bufmode
=
FMCTDC_BUFFER_FIFO
;
int
n_samples
=
-
1
;
int
fmt_wr
=
0
,
flush
=
0
,
read
=
0
;
int
fmt_wr
=
0
,
flush
=
0
,
read
=
0
,
last
=
0
;
char
opt
;
fd_set
rfds
;
struct
sigaction
new_action
,
old_action
;
...
...
@@ -357,7 +357,7 @@ int main(int argc, char **argv)
byte_read
=
fmctdc_read
(
brd
,
i
,
&
ts
,
1
,
nblock
?
O_NONBLOCK
:
0
);
if
(
byte_read
>
0
)
{
dump
(
i
,
&
ts
,
fmt_wr
,
ref
[
i
]
<
0
?
0
:
1
);
dump
(
i
,
&
ts
,
ref
[
i
]
<
0
?
0
:
1
);
ts_prev
[
i
]
=
ts
;
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