Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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 ADC 100M 14b 4cha - Software
Commits
68e7f6f3
Commit
68e7f6f3
authored
Jun 20, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial: tools: use standard optind variable
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
95b2216c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
29 deletions
+7
-29
fald-simple-acq.c
libtools/fald-simple-acq.c
+2
-9
fald-simple-get-conf.c
libtools/fald-simple-get-conf.c
+2
-9
fau-acq-time.c
tools/fau-acq-time.c
+1
-2
fau-trg-config.c
tools/fau-trg-config.c
+2
-9
No files found.
libtools/fald-simple-acq.c
View file @
68e7f6f3
...
...
@@ -56,7 +56,6 @@ int main(int argc, char *argv[])
{
0
,
0
,
0
,
0
}
};
int
opt_index
=
0
,
err
=
0
,
i
;
int
argcd
=
0
;
/* number of argument elaborated */
unsigned
int
dev_id
=
0
;
char
c
;
...
...
@@ -72,11 +71,6 @@ int main(int argc, char *argv[])
/* Parse options */
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"p:P:n:d:D:t:c:h"
,
options
,
&
opt_index
))
>=
0
){
if
(
!
c
)
{
argcd
++
;
continue
;
}
switch
(
c
){
case
'p'
:
fmcadc_set_attr
(
&
acq
,
FMCADC_CONF_ACQ_PRE_SAMP
,
...
...
@@ -111,15 +105,14 @@ int main(int argc, char *argv[])
exit
(
1
);
break
;
}
argcd
+=
2
;
}
if
(
argcd
=
=
argc
-
1
)
{
if
(
optind
!
=
argc
-
1
)
{
printf
(
"Error: DEVICE ID is a mandatory argument
\n
"
);
fald_help
();
exit
(
1
);
}
else
{
sscanf
(
argv
[
argc
-
1
],
"0x%x"
,
&
dev_id
);
sscanf
(
argv
[
optind
],
"0x%x"
,
&
dev_id
);
}
printf
(
"Open ADC fmcadc_100MS_4ch_14bit dev_id 0x%04x ...
\n
"
,
dev_id
);
...
...
libtools/fald-simple-get-conf.c
View file @
68e7f6f3
...
...
@@ -34,7 +34,6 @@ int main(int argc, char *argv[])
{
0
,
0
,
0
,
0
}
};
int
opt_index
=
0
,
err
=
0
,
i
;
int
argcd
=
0
;
/* number of argument elaborated */
unsigned
int
dev_id
=
0
;
char
c
;
...
...
@@ -50,26 +49,20 @@ int main(int argc, char *argv[])
/* Parse options */
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"h"
,
options
,
&
opt_index
))
>=
0
){
if
(
!
c
)
{
argcd
++
;
continue
;
}
switch
(
c
){
case
'h'
:
fald_help
();
exit
(
1
);
break
;
}
argcd
+=
2
;
}
if
(
argcd
=
=
argc
-
1
)
{
if
(
optind
!
=
argc
-
1
)
{
printf
(
"Error: DEVICE ID is a mandatory argument
\n
"
);
fald_help
();
exit
(
1
);
}
else
{
sscanf
(
argv
[
argc
-
1
],
"0x%x"
,
&
dev_id
);
sscanf
(
argv
[
optind
],
"0x%x"
,
&
dev_id
);
}
printf
(
"Open ADC fmcadc_100MS_4ch_14bit dev_id 0x%04x ...
\n
"
,
dev_id
);
...
...
tools/fau-acq-time.c
View file @
68e7f6f3
...
...
@@ -118,7 +118,6 @@ int main(int argc, char *argv[])
{
0
,
0
,
0
,
0
}
};
int
opt_index
=
0
,
err
=
0
;
int
argcd
=
0
;
/* number of argument elaborated */
char
c
;
long
time1
[
3
],
time2
[
3
];
...
...
@@ -135,7 +134,7 @@ int main(int argc, char *argv[])
}
}
if
(
argcd
=
=
argc
-
1
)
{
if
(
optind
!
=
argc
-
1
)
{
printf
(
"Error: DEVICE is a mandatory argument
\n
"
);
fau_help
();
exit
(
1
);
...
...
tools/fau-trg-config.c
View file @
68e7f6f3
...
...
@@ -117,7 +117,6 @@ int main(int argc, char *argv[])
{
0
,
0
,
0
,
0
}
};
int
i
,
opt_index
=
0
,
err
=
0
,
cur_val
;
int
argcd
=
0
;
/* number of argument elaborated */
char
c
;
if
(
argc
==
1
)
{
...
...
@@ -127,11 +126,6 @@ int main(int argc, char *argv[])
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"p:P:n:d:t:c:h"
,
options
,
&
opt_index
))
>=
0
){
if
(
!
c
)
{
argcd
++
;
continue
;
}
switch
(
c
){
case
'p'
:
attrval
[
FAU_TRG_PRE
]
=
atoi
(
optarg
);
...
...
@@ -156,16 +150,15 @@ int main(int argc, char *argv[])
exit
(
1
);
break
;
}
argcd
+=
2
;
}
if
(
argcd
=
=
argc
-
1
)
{
if
(
optind
!
=
argc
-
1
)
{
printf
(
"Error: DEVICE is a mandatory argument
\n
"
);
fau_help
();
exit
(
1
);
}
strcat
(
basepath
,
argv
[
argc
-
1
]);
strcat
(
basepath
,
argv
[
optind
]);
printf
(
"Sysfs path to device is: %s
\n
"
,
basepath
);
for
(
i
=
0
;
i
<
FAU_TRIG_NUM_ATTR
;
++
i
)
{
...
...
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