we should always avoid to use variant handling in software development, because one solution for all variants is the best solution.But sometimes we should compromise due to some limits.
Here are some scenarios I can see now:
- one platform solution for different microconroller/hardware. pre-compile. link different libs
- confilict functions. during-compile
- cross platform(algorithm development on PC, target is other MCU). during-compile. link different libs
- one ECU for different vehicle models. one-time configuraton. bootloader
- differnt Transmission type for one vehicle model. constant configuration
copy choosed target files to target directory
1 |
_____componentA |
during-compile
compile switch(macro)
1 |
|
on the fly
one-time configuraton
parameter is seleted by vehicle configuration shored in NVM/flash.
1 |
typedef enum |
constant configuration
Signal Multiplexing
One signal in the frame is used as a multiplexor and the remaining payload is interpreted depending on the value of the multiplexor signal.
adaptive algorithm
differnt parameter according different condition(eg.temperature/huminity/speed…)
post-compile
link different libs
1 |
-L{path to file containing library} -l${library name} |
merge different parameters
pre-condition: parameter size for different variants is the same
1 |
------ |
1 |
------ |
version control
manage by version tools using branch, development path.
deployment
bootloader
use bootloader to flash seperate calibartion data during End of Line according to different vehilce models.
1 |
------ |
sample label
different executable files for differnt ECUs.
References:
近期评论