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
942ff699
Commit
942ff699
authored
Jun 20, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: use stderr for errors
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
9d406d61
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
24 deletions
+31
-24
fald-simple-acq.c
libtools/fald-simple-acq.c
+12
-10
fald-simple-get-conf.c
libtools/fald-simple-get-conf.c
+13
-11
fau-acq-time.c
tools/fau-acq-time.c
+2
-1
fau-trg-config.c
tools/fau-trg-config.c
+4
-2
No files found.
libtools/fald-simple-acq.c
View file @
942ff699
...
...
@@ -112,7 +112,8 @@ int main(int argc, char *argv[])
}
if
(
optind
!=
argc
-
1
)
{
printf
(
"Error: DEVICE ID is a mandatory argument
\n
"
);
fprintf
(
stderr
,
"%s: DEVICE-ID is a mandatory argument
\n
"
,
argv
[
0
]);
fald_help
();
exit
(
1
);
}
else
{
...
...
@@ -123,7 +124,8 @@ int main(int argc, char *argv[])
/* Open the ADC */
adc
=
fmcadc_open
(
"fmcadc_100MS_4ch_14bit"
,
dev_id
,
0
);
if
(
!
adc
)
{
printf
(
"Cannot open: (%d) %s"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot open device: %s"
,
argv
[
0
],
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
...
...
@@ -131,8 +133,8 @@ int main(int argc, char *argv[])
/* Configure trigger parameter */
err
=
fmcadc_apply_config
(
adc
,
0
,
&
trg
);
if
(
err
&&
errno
!=
FMCADC_ENOMASK
)
{
printf
(
"Cannot apply trigger configuration: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot configure trigger:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
...
...
@@ -140,8 +142,8 @@ int main(int argc, char *argv[])
/* Configure acquisition parameter */
err
=
fmcadc_apply_config
(
adc
,
0
,
&
acq
);
if
(
err
&&
errno
!=
FMCADC_ENOMASK
)
{
printf
(
"Cannot apply acquisition configuration: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot configure acquisition:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
...
...
@@ -149,8 +151,8 @@ int main(int argc, char *argv[])
/* Start acquisition and wait until it completes */
err
=
fmcadc_acq_start
(
adc
,
0
,
NULL
);
if
(
err
)
{
printf
(
"Cannot apply acquisition configuration: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot start acquisition:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
...
...
@@ -158,8 +160,8 @@ int main(int argc, char *argv[])
for
(
i
=
0
;
i
<
acq
.
value
[
FMCADC_CONF_ACQ_N_SHOTS
];
++
i
)
{
err
=
fmcadc_request_buffer
(
adc
,
&
buf
,
0
,
NULL
);
if
(
err
)
{
printf
(
"Cannot retrieve a buffer: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot get a buffer:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
...
...
libtools/fald-simple-get-conf.c
View file @
942ff699
...
...
@@ -58,7 +58,8 @@ int main(int argc, char *argv[])
}
if
(
optind
!=
argc
-
1
)
{
printf
(
"Error: DEVICE ID is a mandatory argument
\n
"
);
fprintf
(
stderr
,
"%s: DEVICE-ID is a mandatory argument
\n
"
,
argv
[
0
]);
fald_help
();
exit
(
1
);
}
else
{
...
...
@@ -69,7 +70,8 @@ int main(int argc, char *argv[])
/* Open the ADC */
adc
=
fmcadc_open
(
"fmcadc_100MS_4ch_14bit"
,
dev_id
,
0
);
if
(
!
adc
)
{
printf
(
"Cannot open: (%d) %s"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot open device: %s"
,
argv
[
0
],
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
...
...
@@ -83,8 +85,8 @@ int main(int argc, char *argv[])
fmcadc_set_attr_mask
(
&
trg
,
FMCADC_CONF_TRG_DELAY
);
err
=
fmcadc_retrieve_config
(
adc
,
&
trg
);
if
(
err
)
{
printf
(
"Cannot retrieve trigger configuration: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot get trigger config:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
printf
(
" source: %s
\n
"
,
...
...
@@ -106,8 +108,8 @@ int main(int argc, char *argv[])
fmcadc_set_attr_mask
(
&
acq
,
FMCADC_CONF_ACQ_N_BITS
);
err
=
fmcadc_retrieve_config
(
adc
,
&
acq
);
if
(
err
)
{
printf
(
"Cannot retrieve acquisition configuration: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot get acquisition config:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
printf
(
" n-shots: %d
\n
"
,
acq
.
value
[
FMCADC_CONF_ACQ_N_SHOTS
]);
...
...
@@ -125,8 +127,8 @@ int main(int argc, char *argv[])
fmcadc_set_attr_mask
(
&
brd
,
FMCADC_BOARD_N_CHAN
);
err
=
fmcadc_retrieve_config
(
adc
,
&
brd
);
if
(
err
)
{
printf
(
"Cannot retrieve board configuration: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
fprintf
(
stderr
,
"%s: cannot get board config:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
printf
(
" n-chan: %d
\n
"
,
brd
.
value
[
FMCADC_BOARD_N_CHAN
]);
...
...
@@ -144,9 +146,9 @@ int main(int argc, char *argv[])
fmcadc_set_attr_mask
(
&
chn
,
FMCADC_CONF_CHN_OFFSET
);
err
=
fmcadc_retrieve_config
(
adc
,
&
chn
);
if
(
err
)
{
printf
(
"Cannot retrieve board configuration: (%d)
%s
\n
"
,
errno
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
fprintf
(
stderr
,
"%s: cannot get channel config:
%s
\n
"
,
argv
[
0
]
,
fmcadc_strerror
(
adc
,
errno
));
exit
(
1
);
}
printf
(
" range: %d
\n
"
,
chn
.
value
[
FMCADC_CONF_CHN_RANGE
]);
printf
(
" 50Ohm Termination: %s
\n
"
,
...
...
tools/fau-acq-time.c
View file @
942ff699
...
...
@@ -135,7 +135,8 @@ int main(int argc, char *argv[])
}
if
(
optind
!=
argc
-
1
)
{
printf
(
"Error: DEVICE is a mandatory argument
\n
"
);
fprintf
(
stderr
,
"%s: DEVICE-ID is a mandatory argument
\n
"
,
argv
[
0
]);
fau_help
();
exit
(
1
);
}
...
...
tools/fau-trg-config.c
View file @
942ff699
...
...
@@ -153,7 +153,8 @@ int main(int argc, char *argv[])
}
if
(
optind
!=
argc
-
1
)
{
printf
(
"Error: DEVICE is a mandatory argument
\n
"
);
fprintf
(
stderr
,
"%s: DEVICE-ID is a mandatory argument
\n
"
,
argv
[
0
]);
fau_help
();
exit
(
1
);
}
...
...
@@ -171,7 +172,8 @@ int main(int argc, char *argv[])
}
err
=
fau_write_attribute
(
i
,
cur_val
);
if
(
err
)
{
printf
(
"Error %d with attribute %d
\n
"
,
err
,
i
);
fprintf
(
stderr
,
"%s: error %d for attribute %d
\n
"
,
argv
[
0
],
err
,
i
);
exit
(
1
);
}
}
...
...
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