I'm working on an project, in one of the source code headers the sw version number is defined in two places, once as a set of defines and in another as a const char string.
I not sure how to have the compiler build the string at compile time so I only have to maintain the version in one place.
Currently I have this in the header:
#define SW_VERSION_MAJOR 1 #define SW_VERSION_MINOR 1 #define SW_VERSION_MAINTENANCE 2 .... const char var_firmware_rev = "1.1.1";
As you can see the two don't match, is there a way to build the var_firmware_rev string from the defined values above?
I'm not looking for a run time solution such as sprinf() as ram is tight on this system, prefer it to be built at compile time and saved in flash(const).