rei:
there are some changes to libmaple/stm32.h in the pipeline which will also make this easier. the development branch is wip-family-support:
https://github.com/leaflabs/libmaple/tree/wip-family-support/
we're updating the <libmaple/stm32.h> include to make it easier to interrogate libmaple about the current build target. new features include:
- STM32_MCU_SERIES: series for the current target. values are STM32_SERIES_F1, STM32_SERIES_F2, etc.
- (for STM32F1 targets): STM32_F1_LINE: line for the current target. values are STM32_LINE_PERFORMANCE, STM32_LINE_VALUE, etc.
thanks to anton eltchaninov, there's going to be value line support in the mainline libmaple tree! F2/F4 work is also getting closer. check out the code for more details. i've also started to update the documentation for this; for now, you can watch the leaflabs-docs branch libmaple-next for more:
https://github.com/leaflabs/leaflabs-docs/tree/libmaple-next
this work has been a long time coming. it's not ready for prime time yet, but we'll be sure to write a blog post when this branch is merged into master.