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
ffa3a2cd
Commit
ffa3a2cd
authored
Apr 15, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fald-acq: check channel number before use it
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
ea0e86a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
fald-acq.c
libtools/fald-acq.c
+13
-1
No files found.
libtools/fald-acq.c
View file @
ffa3a2cd
...
...
@@ -217,12 +217,18 @@ void parse_args(int argc, char *argv[])
val
);
break
;
case
'c'
:
val
=
atoi
(
optarg
);
if
(
val
<
1
||
val
>
4
)
{
fprintf
(
stderr
,
"Invalid channel %d
\n
"
,
val
);
fald_help
();
exit
(
1
);
}
fprintf
(
stdout
,
"FMCADC_CONF_TRG_SOURCE_CHAN: %d
\n
"
,
atoi
(
optarg
));
/* set internal, and then the channel */
fmcadc_set_conf
(
&
trg_cfg
,
FMCADC_CONF_TRG_SOURCE
,
0
);
fmcadc_set_conf
(
&
trg_cfg
,
FMCADC_CONF_TRG_SOURCE_CHAN
,
atoi
(
optarg
)
-
1
);
val
-
1
);
break
;
case
'T'
:
timeout
=
atoi
(
optarg
);
...
...
@@ -246,6 +252,12 @@ void parse_args(int argc, char *argv[])
break
;
case
'g'
:
plot_chno
=
atoi
(
optarg
);
if
(
plot_chno
<
1
||
plot_chno
>
4
)
{
fprintf
(
stderr
,
"Invalid channel %d
\n
"
,
plot_chno
);
fald_help
();
exit
(
1
);
}
fprintf
(
stdout
,
"Plot channel %d
\n
"
,
plot_chno
);
break
;
case
'X'
:
...
...
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