Skip to content
Snippets Groups Projects
Unverified Commit 7220b667 authored by Martine Lenders's avatar Martine Lenders Committed by GitHub
Browse files

Merge pull request #10936 from miri64/sam0_common/fix/check-adc-numof

sam0_common: check ADC_NUMOF on adc_init()
parents 458c95a8 39e90502
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)
int adc_init(adc_t line)
{
if (line >= ADC_NUMOF) {
DEBUG("adc: line arg not applicable\n");
return -1;
}
_prep();
gpio_init(adc_channels[line].pin, GPIO_IN);
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