Discussion Forum

How to define MCU device inside code

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
first last
Posted
24-Apr-2012 18:00 GMT
Toolset
ARM
New! How to define MCU device inside code

Hi,
how can i define device (from Option dialog) inside .c program as predefined macro ?

thanks

Read-Only
Author
Erik Malund
Posted
26-Apr-2012 22:17 GMT
Toolset
ARM
New! depends

why do you want to do it?

Erik

Read-Only
Author
first last
Posted
27-Apr-2012 01:53 GMT
Toolset
ARM
New! RE: depends

I want make some depends from CPU type
for example

#if CPU_TYPE == STM32F205RE #define ...
#elif CPY_TYPE == STM32F205RG #define ...
#endif

Read-Only
Author
Andrew Neil
Posted
27-Apr-2012 20:14 GMT
Toolset
None
New! RE: depends

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

Read-Only
Author
S Steve
Posted
27-Apr-2012 20:37 GMT
Toolset
None
New! RE: depends

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.

Read-Only
Author
first last
Posted
27-Apr-2012 22:41 GMT
Toolset
None
New! RE: depends

Helpfully if Keil add device name as define variable - for example as __DEVICE_TYPE

Next Thread | Thread List | Previous Thread Start a Thread | Settings