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
530e444c
Commit
530e444c
authored
Jan 24, 2013
by
Luis Fernando Ruiz
Committed by
Alessandro Rubini
Feb 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fine-delay/lib: added a device number parameter to fdelay-board-time
parent
363af122
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
fine-delay.in
doc/fine-delay.in
+6
-1
fdelay-board-time.c
lib/fdelay-board-time.c
+17
-6
No files found.
doc/fine-delay.in
View file @
530e444c
...
...
@@ -1396,7 +1396,7 @@ to validate the library works as expected:
@
smallexample
spusa
#
./
lib
/
fdelay
-
board
-
time
25.5
;
./
lib
/
fdelay
-
board
-
time
get
25.50
0661824
25.50
4007360
spusa
#
./
lib
/
fdelay
-
board
-
time
get
34.111048968
spusa
#
./
lib
/
fdelay
-
board
-
time
host
...
...
@@ -1404,6 +1404,11 @@ to validate the library works as expected:
1335974946.493415600
@
end
smallexample
If
more
than
one
@
i
{
fine
-
delay
}
board
is
found
,
the
program
will
also
print
to
@
i
{
stderr
}
how
many
boards
it
finds
and
which
it
is
using
.
To
select
a
board
different
from
the
default
,
you
can
pass
``@
t
{-
i
<
index
>}
''
to
theprogram
,
where
the
index
starts
from
zero
.
@
c
==========================================================================
@
node
Input
Configuration
@
section
Input
Configuration
...
...
lib/fdelay-board-time.c
View file @
530e444c
...
...
@@ -11,12 +11,22 @@ int main(int argc, char **argv)
struct
fdelay_board
*
b
;
int
i
,
get
=
0
,
host
=
0
;
struct
fdelay_time
t
;
int
dev
=
0
;
/* Parse, and kill "-i <devindex>" */
if
(
argc
>
2
&&
!
strcmp
(
argv
[
1
],
"-i"
))
{
dev
=
strtol
(
argv
[
2
],
NULL
,
0
);
argv
[
2
]
=
argv
[
0
];
argc
-=
2
;
}
if
(
argc
!=
2
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s
\"
get
\"
|
\"
host
\"
|"
fprintf
(
stderr
,
"%s: Use
\"
%s
[-i <devindex>
\"
get
\"
|
\"
host
\"
|"
"<float-value>
\"\n
"
,
argv
[
0
],
argv
[
0
]);
exit
(
1
);
}
/* Crappy parser */
if
(
!
strcmp
(
argv
[
1
],
"get"
))
get
=
1
;
...
...
@@ -47,18 +57,19 @@ int main(int argc, char **argv)
fprintf
(
stderr
,
"%s: no boards found
\n
"
,
argv
[
0
]);
exit
(
1
);
}
if
(
i
!=
1
)
{
fprintf
(
stderr
,
"%s: found %i boards, using first one
\n
"
,
argv
[
0
],
i
);
}
if
(
i
!=
1
)
fprintf
(
stderr
,
"%s: found %i boards
\n
"
,
argv
[
0
],
i
);
b
=
fdelay_open
(
0
,
-
1
);
b
=
fdelay_open
(
dev
,
-
1
);
if
(
!
b
)
{
fprintf
(
stderr
,
"%s: fdelay_open(): %s
\n
"
,
argv
[
0
],
strerror
(
errno
));
exit
(
1
);
}
if
(
i
!=
1
)
fprintf
(
stderr
,
"%s: using board %d
\n
"
,
argv
[
0
],
dev
);
if
(
get
)
{
if
(
fdelay_get_time
(
b
,
&
t
)
<
0
)
{
fprintf
(
stderr
,
"%s: fdelay_get_time(): %s
\n
"
,
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