2024-04-19 03:40 AM
Imagine that two .ioc files exist for the same device, with identical peripherals defined but different settings/pin assignments.
If the user code written for device is not affected by the settings change (for example, the pin assignemnt is different for an SPI interface), is it somehow possible to indicate which codebase is to be used when building the application? For example, a CMake option for pointing to the generated code base on a setting, or something similar?
I am looking into maintaining a codebase across different generation of hardware so using such an option would be extremely useful.
Solved! Go to Solution.
2024-04-19 06:48 AM - edited 2024-04-19 07:08 AM
Generally this is done by conditional compilation (a.k.a. #define's) or conditionals in the build - using different libraries (for example, one with UART, another SPI). Eclipse (CubeIDE) supports this by having multiple project configurations. Good luck.
In Eclipse, the project configurations even can depend on different other projects - such as libraries (C/C++ General → Paths and Symbols → References)
2024-04-19 06:48 AM - edited 2024-04-19 07:08 AM
Generally this is done by conditional compilation (a.k.a. #define's) or conditionals in the build - using different libraries (for example, one with UART, another SPI). Eclipse (CubeIDE) supports this by having multiple project configurations. Good luck.
In Eclipse, the project configurations even can depend on different other projects - such as libraries (C/C++ General → Paths and Symbols → References)
2024-04-29 12:46 AM
Thanks Pavel, I think going about it manually through using #defines is the way to go.