Skip to content
Snippets Groups Projects
Commit 39e90502 authored by Martine Lenders's avatar Martine Lenders
Browse files

sam0_common: check ADC_NUMOF on adc_init()

parent 3995fd87
No related branches found
No related tags found
No related merge requests found
...@@ -156,6 +156,10 @@ static int _adc_configure(adc_res_t res) ...@@ -156,6 +156,10 @@ static int _adc_configure(adc_res_t res)
int adc_init(adc_t line) int adc_init(adc_t line)
{ {
if (line >= ADC_NUMOF) {
DEBUG("adc: line arg not applicable\n");
return -1;
}
_prep(); _prep();
gpio_init(adc_channels[line].pin, GPIO_IN); gpio_init(adc_channels[line].pin, GPIO_IN);
gpio_init_mux(adc_channels[line].pin, GPIO_MUX_B); gpio_init_mux(adc_channels[line].pin, GPIO_MUX_B);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment