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
6727e28c
Commit
6727e28c
authored
Mar 24, 2014
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/fmc-fdelay-pulse: parse '-D' as <secs>:<nanos> as advertized
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
981ae3f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
fmc-fdelay-pulse.c
tools/fmc-fdelay-pulse.c
+12
-3
No files found.
tools/fmc-fdelay-pulse.c
View file @
6727e28c
...
...
@@ -20,7 +20,7 @@ void help(char *name)
" -o <output> ouput channel: 1..4 (default 1)
\n
"
" -c <count> default is 0 and means forever
\n
"
" -m <mode>
\"
pulse
\"
(default),
\"
delay
\"
,
\"
disable
\"\n
"
" -r <reltime> relative time
\n
"
" -r <reltime> relative time
, e.g.
\"
10m+20u
\"
-- use m,u,n,p and add/sub
\n
"
" -D <date> absolute time, <secs>:<nano>
\n
"
" -T <period> period, e.g.
\"
50m-20n
\"
-- use m,u,n,p and add/sub
\n
"
" -w <width> like period; defaults to 50%% period
\n
"
...
...
@@ -179,8 +179,17 @@ void parse_reltime(struct fdelay_pulse *p, char *s)
void
parse_abstime
(
struct
fdelay_pulse
*
p
,
char
*
s
)
{
memset
(
&
p
->
start
,
0
,
sizeof
(
p
->
start
));
parse_time
(
s
,
&
p
->
start
);
unsigned
long
long
utc
;
unsigned
long
nanos
;
char
c
;
if
(
sscanf
(
s
,
"%llu:%lu%c"
,
&
utc
,
&
nanos
,
&
c
)
!=
2
)
{
fprintf
(
stderr
,
"Wrong <sec>:<nano> string
\"
%s
\"\n
"
,
s
);
exit
(
1
);
}
p
->
start
.
utc
=
utc
;
p
->
start
.
coarse
=
nanos
/
8
;
p
->
start
.
frac
=
(
nanos
%
8
)
*
512
;
}
void
parse_period
(
struct
fdelay_pulse
*
p
,
char
*
s
)
...
...
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