Fixed F1 build

This commit is contained in:
Martin Budden 2017-12-01 06:50:34 +00:00
parent ce345a8446
commit d6d70d5a74
3 changed files with 8 additions and 13 deletions

View File

@ -61,7 +61,7 @@ VCP_SRC = \
MCU_COMMON_SRC = \
drivers/adc_stm32f10x.c \
drivers/bus_i2c_stm32f10x.c \
drivers/bus_std_periph.c \
drivers/bus_spi_stdperiph.c \
drivers/dma.c \
drivers/inverter.c \
drivers/light_ws2811strip_stdperiph.c \

View File

@ -96,9 +96,16 @@ bool adcVerifyPin(ioTag_t tag, ADCDevice device)
}
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))) {
return true;
}
#endif
}
return false;

View File

@ -37,18 +37,6 @@ const adcDevice_t adcHardware[] = {
{ .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[] = {
{ DEFIO_TAG_E__PA0, ADC_Channel_0 }, // ADC12
{ DEFIO_TAG_E__PA1, ADC_Channel_1 }, // ADC12