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
972b0f68
Commit
972b0f68
authored
May 08, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: added -w to fdelay-pulse program
parent
b2ca0d8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
fdelay-pulse.c
lib/fdelay-pulse.c
+24
-2
No files found.
lib/fdelay-pulse.c
View file @
972b0f68
...
...
@@ -43,14 +43,22 @@ static int parse_time(struct fdelay_board *b, char *s, struct fdelay_time *t)
int
main
(
int
argc
,
char
**
argv
)
{
struct
fdelay_board
*
b
;
int
i
,
devid
,
channel
;
int
i
,
devid
,
channel
,
needwait
=
0
;
struct
fdelay_pulse
p
;
char
*
rest
;
if
(
argc
<
7
)
exiterr
(
argc
,
argv
);
/* Optional argv[1] is a number */
/* Optional argv[1] is "-w" */
if
(
!
strcmp
(
argv
[
1
],
"-w"
))
{
needwait
++
;
argv
[
1
]
=
argv
[
0
];
argv
++
;
argc
--
;
}
/* Next optional argv[1] is a number */
rest
=
strdup
(
argv
[
1
]);
if
(
sscanf
(
argv
[
1
],
"%x%s"
,
&
devid
,
rest
)
!=
1
)
{
devid
=
0
;
...
...
@@ -61,6 +69,9 @@ int main(int argc, char **argv)
}
free
(
rest
);
if
(
argc
<
7
)
/* again: we ate some arguments */
exiterr
(
argc
,
argv
);
/* Crappy parser */
if
(
!
strcmp
(
argv
[
1
],
"disable"
))
p
.
mode
=
FD_OUT_MODE_DISABLED
;
...
...
@@ -143,6 +154,17 @@ int main(int argc, char **argv)
exit
(
1
);
}
while
(
needwait
)
{
usleep
(
10
*
1000
);
i
=
fdelay_has_triggered
(
b
,
channel
);
if
(
i
<
0
)
{
fprintf
(
stderr
,
"%s: waiting for trigger: %s
\n
"
,
argv
[
0
],
strerror
(
errno
));
exit
(
1
);
}
needwait
=
!
i
;
}
fdelay_close
(
b
);
fdelay_exit
();
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