Can I know using a #ifdef if there is a STM32F3 or STM32F4?
My idea is to write a cross mcu source.
Dear Denis Gottardello,
You can get some information about MCU device and revision from DBGMCU. You can refer to your reference manual for more details on how to use DBGMCU.
Those are runtime values. If you want compile time values, you should really make your own. Look at some open source projects on github, they often require this for compilers as well.
If you put them in the flags (eg: the makefile) they will be defined in the whole project. Like those compiler type defines.
The inference was that pre-processor were not the goal, although it is the most practical.
There are however significant hurdles for figuring it out on the fly, given the peripherals, clocks and buses are arranged differently you'd end up with the code for both being built.
Within a single family (ie F4) using DEVID is an effective way to determine and dynamically set the clocks/buses in maximal configurations.
Retrieving data ...