Commit a20673aa authored by Federico Vaga's avatar Federico Vaga

lib: add special error code for 'no sw trigger'

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 8ba919e1
......@@ -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
......
......@@ -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, }
};
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment