Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/29/05 06:27
Read: times


 
#96154 - Thank you
Responding to: ???'s previous message
Hi all,

Thank you for your feedback. I am aware of the logic behind Keil's handling of the issue. I am not disputing whether it is correct or wrong. My focus of the query is not that.

I have a code which compiles correctly in IAR. The definitions are handled as indended. I find this feature useful in writing crystal depended definitions. Hence my query was, is it possible to do in the same way in Keil and how. After some reasearch and as well as from your feedback, I realise Keil needs some modifications. To illustrate,

#define Xtal 22.1184
#define tic12 (12/Xtal)
#define _10msec (65536 - ((1000 * 10) / tic12))

Before modification
{
.
TL1 = _10msec;
TH1 = _10msec >> 8 ;
.
}

After modification
{
uint temp = _10msec;
.
TL1 = temp ;
TH1 = temp >> 8 ;
.
}

In the former case Keil produces a "Bad operand >> error", whereas the second case it produced the indended code. May be I am still ignorant and missing something.

regards,



List of 31 messages in thread
TopicAuthorDate
defination under Keil            01/01/70 00:00      
   int/float            01/01/70 00:00      
   IAR PreProcessor VS Keil            01/01/70 00:00      
      confusion            01/01/70 00:00      
         just doing text subistituons I guess            01/01/70 00:00      
            un            01/01/70 00:00      
               preprocessor            01/01/70 00:00      
                  Some confusion abounds...            01/01/70 00:00      
                     Wrong again!            01/01/70 00:00      
                        Take is easy...            01/01/70 00:00      
                           The important bit...?            01/01/70 00:00      
         Floating-point not supported in eval            01/01/70 00:00      
      preprocessor maths            01/01/70 00:00      
         I was being carelessly loose............            01/01/70 00:00      
            Keil Test            01/01/70 00:00      
            Save you the trouble            01/01/70 00:00      
               Oh            01/01/70 00:00      
         preproccessor maths            01/01/70 00:00      
            ##########            01/01/70 00:00      
               thats the confusion            01/01/70 00:00      
                  In context            01/01/70 00:00      
                     Thanks            01/01/70 00:00      
                  Think about it            01/01/70 00:00      
   Aside - 'C' #define names            01/01/70 00:00      
      good coding practices            01/01/70 00:00      
   Thank you            01/01/70 00:00      
      Alternatively...            01/01/70 00:00      
         re: Alternatively...            01/01/70 00:00      
      Not a good idea            01/01/70 00:00      
         Not a good idea            01/01/70 00:00      
         floating point in ISRs            01/01/70 00:00      

Back to Subject List