March 30, 2020 at 12:39 PM #1 Hi,I would like to print define value using printf, for example:#define MODULE_NAME MODULE1printf (MODULE_NAME);Is there any way to do so without adding commas to the test ("MODULE1")?Thanks,eyal.
March 30, 2020 at 11:47 PM #2 By "commas" you mean "quotes" ?Remember that the preprocessor just does a simple text substitutionSo, for this to work, your #define must expand to something that would be valid as a printf argument.So, if you want MODULE_NAME to expand to a string, you will have to define it as such; eg,#define MODULE_NAME "MODULE1"Then you can put MODULE_NAME anywhere that a string literal would be legal.Note that this is standard 'C' stuff - nothing specific to Segger or SES