We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, how can i define device (from Option dialog) inside .c program as predefined macro ?
thanks
I want make some depends from CPU type for example
#if CPU_TYPE == STM32F205RE #define ... #elif CPY_TYPE == STM32F205RG #define ... #endif
I think that it is a major omission that uVision does not make any of the GUI settings available to the code; eg, by command-line defines, or an auto-generated header.
It has been noted here many times before.
I had a quick look, and I can't see anything to suggest that it's been added recently.
For the specific case of the CPU_TYPE, you could look at: http://www.keil.com/support/man/docs/uv4/uv4_ut_keysequence.htm
Maybe also look at: http://www.keil.com/support/man/docs/uv4/uv4_ut_configwizard.htm
I think that it is a major omission ...
Might be useful (though exactly how useful is debatable), but really don't think it could be classed as a major omission.
Helpfully if Keil add device name as define variable - for example as __DEVICE_TYPE