Fixed F1 build
This commit is contained in:
parent
ce345a8446
commit
d6d70d5a74
|
@ -61,7 +61,7 @@ VCP_SRC = \
|
||||||
MCU_COMMON_SRC = \
|
MCU_COMMON_SRC = \
|
||||||
drivers/adc_stm32f10x.c \
|
drivers/adc_stm32f10x.c \
|
||||||
drivers/bus_i2c_stm32f10x.c \
|
drivers/bus_i2c_stm32f10x.c \
|
||||||
drivers/bus_std_periph.c \
|
drivers/bus_spi_stdperiph.c \
|
||||||
drivers/dma.c \
|
drivers/dma.c \
|
||||||
drivers/inverter.c \
|
drivers/inverter.c \
|
||||||
drivers/light_ws2811strip_stdperiph.c \
|
drivers/light_ws2811strip_stdperiph.c \
|
||||||
|
|
|
@ -96,9 +96,16 @@ bool adcVerifyPin(ioTag_t tag, ADCDevice device)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int map = 0 ; map < ADC_TAG_MAP_COUNT ; map++) {
|
for (int map = 0 ; map < ADC_TAG_MAP_COUNT ; map++) {
|
||||||
|
#if defined(STM32F1)
|
||||||
|
UNUSED(device);
|
||||||
|
if ((adcTagMap[map].tag == tag)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if ((adcTagMap[map].tag == tag) && (adcTagMap[map].devices & (1 << device))) {
|
if ((adcTagMap[map].tag == tag) && (adcTagMap[map].devices & (1 << device))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -37,18 +37,6 @@ const adcDevice_t adcHardware[] = {
|
||||||
{ .ADCx = ADC1, .rccADC = RCC_APB2(ADC1), .DMAy_Channelx = DMA1_Channel1 }
|
{ .ADCx = ADC1, .rccADC = RCC_APB2(ADC1), .DMAy_Channelx = DMA1_Channel1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
ADCDevice adcDeviceByInstance(ADC_TypeDef *instance)
|
|
||||||
{
|
|
||||||
if (instance == ADC1)
|
|
||||||
return ADCDEV_1;
|
|
||||||
|
|
||||||
/* TODO -- ADC2 available on large 10x devices.
|
|
||||||
if (instance == ADC2)
|
|
||||||
return ADCDEV_2;
|
|
||||||
*/
|
|
||||||
return ADCINVALID;
|
|
||||||
}
|
|
||||||
|
|
||||||
const adcTagMap_t adcTagMap[] = {
|
const adcTagMap_t adcTagMap[] = {
|
||||||
{ DEFIO_TAG_E__PA0, ADC_Channel_0 }, // ADC12
|
{ DEFIO_TAG_E__PA0, ADC_Channel_0 }, // ADC12
|
||||||
{ DEFIO_TAG_E__PA1, ADC_Channel_1 }, // ADC12
|
{ DEFIO_TAG_E__PA1, ADC_Channel_1 }, // ADC12
|
||||||
|
|
Loading…
Reference in New Issue