mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #10936 from miri64/sam0_common/fix/check-adc-numof
sam0_common: check ADC_NUMOF on adc_init()
This commit is contained in:
commit
7220b66708
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user