I need to find a way to get my defines to run time data. Or at least to satisfy the function that needs it.
For example, and I know this wont work, but like this
if(1) { #define CFG_DEVICE_NAME 't','e','s','t', #define CFG_DEVICE_NAME_SIZE 4 } else { #define CFG_DEVICE_NAME 'T','E','S','T' #define CFG_DEVICE_NAME_SIZE 4 } int descStringDevice[] PROGMEM= { CFG_DEVICE_NAME_SIZE | (3<<8), CFG_DEVICE_NAME } ;
Naturally you will get the second as you have two defines. I tried this.
extern char CFG_DEVICE_NAME [] ={'t','e','s','t' };
CFG_DEVICE_NAME_SIZE = 4;
and all sorts of ways to make things work but I get initializer element is not constant for the CFG_DEVICE_NAME_SIZE. The compiler is ok with CFG_DEVICE_NAME, buts its not showing the string right.
Is there any way to set these defines dynamically?