This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/CC3220: #define syntax issue

Part Number: CC3220

Tool/software: TI C/C++ Compiler

I have a #define for a string that contains another #define of the firmware version.  I have used this method successfully on other compilers, but the TI one does not seem to like it.

 

// This doesn’t compile I get an error “expected a ;”

#define FIRMWARE VERSION                     "V0.0.1"

#define MQTT_WILL_MESSAGE                  "{\"firmware\":\""FIRMWARE_VERSION"\",\"code\":\"WILL_MESSAGE\"}"

 

// This does compile and I just manually did the text replacement

#define MQTT_WILL_MESSAGE                  "{\"firmware\":\"""V0.0.1""\",\"code\":\"WILL_MESSAGE\"}"

Any workarounds or ideas?