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
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
misc
adc-lib
Commits
a20673aa
Commit
a20673aa
authored
Oct 12, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: add special error code for 'no sw trigger'
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
8ba919e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
adc-lib.h
lib/adc-lib.h
+1
-0
lib.c
lib/lib.c
+1
-0
route.c
lib/route.c
+2
-1
No files found.
lib/adc-lib.h
View file @
a20673aa
...
...
@@ -26,6 +26,7 @@ extern "C" {
#define ADC_ENOMASK 1030
#define ADC_EDISABLED 1031
#define ADC_EROUTE 1032
#define ADC_ENOP_SWTRG 1033
/**
* Opaque type. any instance of this should be used as token
...
...
lib/lib.c
View file @
a20673aa
...
...
@@ -31,6 +31,7 @@ static struct adc_errors {
{
ADC_ENOMASK
,
"Missing configuration mask"
},
{
ADC_EDISABLED
,
"Trigger is disabled: I/O aborted"
},
{
ADC_EROUTE
,
"Cannot route correctly the configuration"
},
{
ADC_ENOP_SWTRG
,
"Operation not supported: software trigger"
},
{
0
,
}
};
...
...
lib/route.c
View file @
a20673aa
...
...
@@ -508,6 +508,7 @@ int adc_has_trigger_fire(struct adc_dev *dev)
* It forces the board to trigger the acquisition
* @param[in] dev ADC device token
* @return 0 on success, -1 on error and errno is set appropriately
* ADC_ENOP_SWTRG: when software trigger is not supported
*/
int
adc_trigger_fire
(
struct
adc_dev
*
dev
)
{
...
...
@@ -515,7 +516,7 @@ int adc_trigger_fire(struct adc_dev *dev)
const
struct
adc_board_type
*
b
=
g
->
board
;
if
(
!
b
->
adc_op
->
trigger_fire
)
{
errno
=
ADC_ENOP
;
errno
=
ADC_ENOP
_SWTRG
;
return
-
1
;
}
return
b
->
adc_op
->
trigger_fire
(
dev
);
...
...
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