mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #4914 from gebart/pr/stm32f0-adc-default-error
cpu/stm32f0: adc: Add default error cases
This commit is contained in:
commit
e1909d861b
@ -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…
Reference in New Issue
Block a user