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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/10/11 08:47
Read: times


 
#182572 - defining P0_6 so that compiler doesn't treat it as volatile
Responding to: ???'s previous message
Sandy B. Pal said:
Is there any other way of defining this P0_6 so that compiler doesn't treat it as volatile bit?


Why on earth would you not want it treated as volatile??!!

An external input pin can, obviously, change its value completely independently of the software - so this is an absolutely classic case of where it really should be volatile!

If you want to "latch" a value read from a port or pin, use a suitable variable to hold your "sampled" value...

List of 17 messages in thread
TopicAuthorDate
Compiler variations??            01/01/70 00:00      
   Fundamental philosophy of High-Level Languges (HLL)            01/01/70 00:00      
      C code            01/01/70 00:00      
         and so what            01/01/70 00:00      
         Stop wondering about the compiler output            01/01/70 00:00      
            Very nice to learn this important matter            01/01/70 00:00      
         Exactly what you wrote            01/01/70 00:00      
            volatile sbit may be the problem            01/01/70 00:00      
               read up on (not) volatile            01/01/70 00:00      
               Look at my profile            01/01/70 00:00      
                  Not offence intended            01/01/70 00:00      
                     defining P0_6 so that compiler doesn't treat it as volatile            01/01/70 00:00      
                        Skip the goto - almost always exists beautiful rewrites            01/01/70 00:00      
                           Goto really is a bastard code construct            01/01/70 00:00      
                              and therefore ...            01/01/70 00:00      
                                 Will come back with modified code            01/01/70 00:00      
                           Wonderful as always!            01/01/70 00:00      

Back to Subject List