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
3d0a728f
Commit
3d0a728f
authored
Jul 22, 2015
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: read last time stamp mode
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
598a50d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
fmc-tdc-tstamp.c
tools/fmc-tdc-tstamp.c
+15
-6
No files found.
tools/fmc-tdc-tstamp.c
View file @
3d0a728f
...
...
@@ -99,6 +99,7 @@ static void help(char *name)
fprintf
(
stderr
,
" -r: read buffer, no acquisition start
\n
"
);
fprintf
(
stderr
,
" -m: buffer mode: 'fifo' or 'circ'
\n
"
);
fprintf
(
stderr
,
" -l: maximum buffer lenght
\n
"
);
fprintf
(
stderr
,
" -L:
\t
keep reading from the last hardware timestamp instead than from the proper buffer
\n
"
);
fprintf
(
stderr
,
" -h: print this message
\n\n
"
);
fprintf
(
stderr
,
" channels enumerations go from %d to %d
\n\n
"
,
FMCTDC_CH_1
,
FMCTDC_CH_LAST
);
...
...
@@ -150,7 +151,7 @@ int main(int argc, char **argv)
ref
[
i
]
=
-
1
;
/* Parse Options */
while
((
opt
=
getopt
(
argc
,
argv
,
"hwns:d:frm:l:c:"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"hwns:d:frm:l:
L
c:"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'h'
:
case
'?'
:
...
...
@@ -203,6 +204,9 @@ int main(int argc, char **argv)
}
ref
[
b
]
=
a
;
break
;
case
'L'
:
last
=
1
;
break
;
case
'c'
:
if
(
chan_count
>=
FMCTDC_NUM_CHANNELS
)
{
fprintf
(
stderr
,
...
...
@@ -292,7 +296,7 @@ int main(int argc, char **argv)
/* Read Time-Stamps */
n
=
0
;
while
((
n
<
n_samples
||
n_samples
<=
0
)
&&
(
!
stop
))
{
if
(
!
nblock
)
{
if
(
!
nblock
&&
!
last
)
{
ret
=
poll
(
p
,
FMCTDC_NUM_CHANNELS
,
10
);
if
(
ret
<=
0
)
continue
;
...
...
@@ -304,10 +308,15 @@ int main(int argc, char **argv)
if
(
fd
<
0
)
continue
;
if
(
!
(
p
[
ch_valid
[
i
]].
revents
&
POLLIN
))
continue
;
byte_read
=
fmctdc_read
(
brd
,
i
,
&
ts
,
1
,
nblock
?
O_NONBLOCK
:
0
);
/* Read from buffer */
if
(
last
)
{
byte_read
=
fmctdc_read_last
(
brd
,
i
,
&
ts
);
}
else
{
if
(
!
(
p
[
ch_valid
[
i
]].
revents
&
POLLIN
))
continue
;
byte_read
=
fmctdc_read
(
brd
,
i
,
&
ts
,
1
,
nblock
?
O_NONBLOCK
:
0
);
}
if
(
byte_read
>
0
)
{
dump
(
i
,
&
ts
,
ref
[
i
]
<
0
?
0
:
1
);
...
...
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