Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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
Commits
0a5250ae
Commit
0a5250ae
authored
May 05, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fd-raw-input: added hack: getenv(EXPECTED_RATE)
parent
359b24c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
fd-raw-input.c
tools/fd-raw-input.c
+16
-1
No files found.
tools/fd-raw-input.c
View file @
0a5250ae
...
...
@@ -27,12 +27,15 @@
enum
{
MODE_HEX
,
MODE_FLOAT
,
MODE_PICO
};
int
expect
;
void
event
(
uint32_t
*
a
,
char
*
name
,
int
*
seq
,
int
mode
,
long
double
*
t1
,
uint64_t
*
p1
)
{
int
sequence
=
a
[
FD_ATTR_TDC_SEQ
];
long
double
t2
;
int64_t
p2
,
delta
;
static
int64_t
guess
;
if
(
*
seq
!=
-
1
)
{
if
(
sequence
!=
((
*
seq
+
1
)
&
0xffff
))
{
...
...
@@ -74,10 +77,19 @@ void event(uint32_t *a, char *name, int *seq, int mode, long double *t1,
if
(
delta
<
0
)
delta
+=
1000LL
*
1000
*
1000
*
1000
;
if
(
*
p1
)
{
printf
(
"%012lli - delta %012lli
\n
"
,
p2
,
delta
);
printf
(
"%012lli - delta %012lli"
,
p2
,
delta
);
if
(
expect
)
{
guess
+=
expect
;
if
(
guess
>
1000LL
*
1000
*
1000
*
1000
)
guess
-=
1000LL
*
1000
*
1000
*
1000
;
printf
(
" - error %6i"
,
(
int
)(
p2
-
guess
));
}
putchar
(
'\n'
);
}
else
{
printf
(
"%012lli
\n
"
,
p2
);
if
(
expect
)
guess
=
p2
;
}
*
p1
=
p2
;
break
;
...
...
@@ -98,6 +110,9 @@ int main(int argc, char **argv)
uint64_t
p1
[
MAXFD
]
=
{
0LL
,};
uint32_t
*
attrs
;
if
(
getenv
(
"EXPECTED_RATE"
))
expect
=
atoi
(
getenv
(
"EXPECTED_RATE"
));
if
(
argc
>
1
&&
!
strcmp
(
argv
[
1
],
"-f"
))
{
mode
=
MODE_FLOAT
;
argv
[
1
]
=
argv
[
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