Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
adc-lib
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
adc-lib
Commits
97077164
Commit
97077164
authored
Mar 18, 2022
by
Federico Vaga
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/tools-improve' into develop
parents
4a5209d6
dfc48fbe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
adc-acq.c
tools/adc-acq.c
+10
-4
No files found.
tools/adc-acq.c
View file @
97077164
...
...
@@ -40,7 +40,7 @@ static unsigned arg_plot_selected = 0;
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
static
const
char
*
help_msg
=
"adc-acq -D <device-name>@
0x
<device-id> [OPTIONS]
\n\n
"
;
"adc-acq -D <device-name>@<device-id> [OPTIONS]
\n\n
"
;
static
const
char
*
help_msg_opt
=
" --device|-D <device-name>@<device-id>: unique device identifier (e.g.:
\"
fmc-adc@0x0400
\"
)
\n
"
" --acquisition|-a <parameters> configure the acquisition
\n
"
...
...
@@ -1137,6 +1137,7 @@ static int fald_acq_parse_args_basic(int argc, char *argv[])
switch
(
c
)
{
case
'D'
:
{
char
*
strdevid
;
char
*
eptr
;
int
len
;
strdevid
=
strchr
(
optarg
,
'@'
);
...
...
@@ -1145,13 +1146,18 @@ static int fald_acq_parse_args_basic(int argc, char *argv[])
_argv
,
optarg
);
exit
(
1
);
}
strdevid
++
;
/* +1 to skip '@' */
sscanf
(
strdevid
,
"0x%x"
,
&
devid
);
/* +1 to skip '@' */
devid
=
strtoul
(
strdevid
+
1
,
&
eptr
,
0
);
if
(
*
eptr
!=
0
)
{
fprintf
(
stderr
,
"%s: invalid device-id
\"
%s
\"
(<type>@<device-id>)
\n
"
,
_argv
,
optarg
);
exit
(
1
);
}
/* -1 count '@' it will be replaced by 0
* +1 for \0
*/
len
=
(
int
)(
strdevid
-
1
-
optarg
+
1
);
len
=
(
int
)(
strdevid
-
optarg
+
1
);
devname
=
malloc
(
len
);
if
(
!
devname
)
{
fprintf
(
stderr
,
"Cannot allocate memory
\n
"
);
...
...
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