cpu/stm32f0: adc: Add default error cases
This commit is contained in:
parent
30e42669d6
commit
ade9941ab6
@ -53,6 +53,8 @@ int adc_init(adc_t dev, adc_precision_t precision)
|
|||||||
(3 << ADC_0_CH4_PIN) | (3 << ADC_0_CH5_PIN));
|
(3 << ADC_0_CH4_PIN) | (3 << ADC_0_CH5_PIN));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reset control registers */
|
/* reset control registers */
|
||||||
@ -79,7 +81,6 @@ int adc_init(adc_t dev, adc_precision_t precision)
|
|||||||
case ADC_RES_16BIT:
|
case ADC_RES_16BIT:
|
||||||
adc_poweroff(dev);
|
adc_poweroff(dev);
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* configure sampling time to 41.5 cycles */
|
/* configure sampling time to 41.5 cycles */
|
||||||
@ -123,6 +124,8 @@ int adc_sample(adc_t dev, int channel)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* start single conversion */
|
/* start single conversion */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user