Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - 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 DEL 1ns 4cha - Software
Commits
5ad77722
Commit
5ad77722
authored
May 02, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fd-raw-input: use attr names, not numbers
parent
b3b978a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
fd-raw-input.c
tools/fd-raw-input.c
+17
-11
No files found.
tools/fd-raw-input.c
View file @
5ad77722
...
...
@@ -32,10 +32,11 @@ int main(int argc, char **argv)
{
glob_t
glob_buf
;
int
fd
[
MAXFD
];
int
i
,
j
,
maxfd
=
0
,
last
=
0
;
int
i
,
j
,
maxfd
=
0
,
sequence
,
last
=
0
;
fd_set
allset
,
curset
;
int
floatmode
=
0
;
long
double
t1
=
0
.
0
,
t2
;
uint32_t
*
attrs
;
if
(
argc
>
1
&&
!
strcmp
(
argv
[
1
],
"-f"
))
{
floatmode
=
1
;
...
...
@@ -93,6 +94,8 @@ int main(int argc, char **argv)
case
0
:
continue
;
}
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
!
FD_ISSET
(
fd
[
i
],
&
curset
))
continue
;
...
...
@@ -103,14 +106,17 @@ int main(int argc, char **argv)
argv
[
0
],
j
,
sizeof
(
ctrl
));
exit
(
1
);
}
if
(
ctrl
.
attr_channel
.
ext_val
[
4
]
-
last
!=
1
)
attrs
=
ctrl
.
attr_channel
.
ext_val
;
sequence
=
attrs
[
FD_ATTR_IN_SEQ
];
if
(
sequence
-
last
!=
1
)
printf
(
"%s: LOST %i events
\n
"
,
argv
[
i
],
ctrl
.
attr_channel
.
ext_val
[
4
]
-
last
-
1
);
last
=
ctrl
.
attr_channel
.
ext_val
[
4
]
;
sequence
-
last
-
1
);
last
=
sequence
;
printf
(
"%s: "
,
argv
[
i
]);
if
(
floatmode
)
{
t2
=
ctrl
.
attr_channel
.
ext_val
[
1
]
+
ctrl
.
attr_channel
.
ext_val
[
2
]
t2
=
attrs
[
FD_ATTR_IN_UTC_L
]
+
attrs
[
FD_ATTR_IN_COARSE
]
*
.
00000000
8
;
/* 8ns */
if
(
t1
)
{
printf
(
"%17.9Lf (delta %13.9Lf)
\n
"
,
...
...
@@ -122,11 +128,11 @@ int main(int argc, char **argv)
continue
;
}
printf
(
"%08x %08x %08x %08x %08x
\n
"
,
ctrl
.
attr_channel
.
ext_val
[
0
],
ctrl
.
attr_channel
.
ext_val
[
1
],
ctrl
.
attr_channel
.
ext_val
[
2
],
ctrl
.
attr_channel
.
ext_val
[
3
],
ctrl
.
attr_channel
.
ext_val
[
4
]);
attrs
[
FD_ATTR_IN_UTC_H
],
attrs
[
FD_ATTR_IN_UTC_L
],
attrs
[
FD_ATTR_IN_COARSE
],
attrs
[
FD_ATTR_IN_FRAC
],
attrs
[
FD_ATTR_IN_SEQ
]);
}
}
return
0
;
...
...
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