<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Changing #define</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/38238/changing-define</link><description> 
Hello, 

 
In programme I have defined 

 
#define DEVICE_ID 0x32 

 
But I want to change Device Id when I get command of change Device
Address. 

 
How should I do it? 

 
Regards, 
Abhijeet R. Mudgal. 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Changing #define</title><link>https://community.arm.com/thread/55468?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2009 02:08:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:709b8f0c-3a3d-478e-a479-c0616a683572</guid><dc:creator>aamir khan</dc:creator><description>&lt;p&gt;&lt;p&gt;
u cant do it like that&lt;br /&gt;
coz DEVICE_ID is replaced by 0x32 where ever u hve written it by
compiler&lt;br /&gt;
if u wana assign DEVICE_ID different Values that declear it as
variable in user program&lt;br /&gt;
not in this way&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing #define</title><link>https://community.arm.com/thread/55466?ContentTypeID=1</link><pubDate>Fri, 20 Feb 2009 02:03:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:16fe90d2-6b92-4c7c-be88-aea3ea142aeb</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
This is standard, textbook &amp;#39;C&amp;#39; - nothing specifically to do with
the 8051 or Keil.&lt;/p&gt;

&lt;p&gt;
#define gives a definition that is fixed at compile time;&lt;/p&gt;

&lt;p&gt;
IF you want it to be changeable at run time, you will need to use
a variable.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>