stm32/adc: Remove unused macro and channel check, and fix spacing.
The call to is_adcx_channel is redundant because the channel is already checked just before calling adc_init_single in adc_make_new.
This commit is contained in:
parent
cb2b210d45
commit
d523a377d1
|
@ -63,7 +63,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ADCx_CLK_ENABLE __HAL_RCC_ADC1_CLK_ENABLE
|
#define ADCx_CLK_ENABLE __HAL_RCC_ADC1_CLK_ENABLE
|
||||||
#define ADC_NUM_CHANNELS (19)
|
|
||||||
|
|
||||||
#if defined(STM32F0)
|
#if defined(STM32F0)
|
||||||
|
|
||||||
|
@ -293,9 +292,6 @@ STATIC void adcx_init_periph(ADC_HandleTypeDef *adch, uint32_t resolution) {
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC void adc_init_single(pyb_obj_adc_t *adc_obj) {
|
STATIC void adc_init_single(pyb_obj_adc_t *adc_obj) {
|
||||||
if (!is_adcx_channel(adc_obj->channel)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ADC_FIRST_GPIO_CHANNEL <= adc_obj->channel && adc_obj->channel <= ADC_LAST_GPIO_CHANNEL) {
|
if (ADC_FIRST_GPIO_CHANNEL <= adc_obj->channel && adc_obj->channel <= ADC_LAST_GPIO_CHANNEL) {
|
||||||
// Channels 0-16 correspond to real pins. Configure the GPIO pin in ADC mode.
|
// Channels 0-16 correspond to real pins. Configure the GPIO pin in ADC mode.
|
||||||
|
|
Loading…
Reference in New Issue