You started a parallel thread How to enable 12bit for STM32F103
that logically continues from the beginning part of this one. Separating this across two threads will waste everyone’s time.
What you need to do is determine whether __arm__
or anything else that indicates that you have a 12-bit ADC is set, then use that to switch ADC_BITS from 10 to 12. What you appear to have done will cause bad results for any sketch you compile for a 10-bit ADC. Do not forget that the same library is used in every sketch, unless you fork your own version, which you keep just for the STM board. And if you do that, you can leave out the test for __arm__
and simply write #define ADC_BITS 12