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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/01/03 14:56
Read: times


 
#35341 - RE: Keil C - Andy
Hi Rob,

as Jon pointed right, there exist no rule, how bit fields arranged into a byte.

So using bit fields on a port variable, locks never elegant, since it can cause a different pin usage on different ANSI compilers !

So it looks only possible faulty !


I try always to avoid such ANSI C statements, which can work compiler dependent.

And on ports e.g. it is possible to use masking bits inside a byte:

P1 |= 1<<2; // set P1.2

Furthermore on the 8051 exist some C language extensions to access port pins directly (sbit).


Peter


List of 18 messages in thread
TopicAuthorDate
Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place ... Erik            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - Andy            01/01/70 00:00      
RE: Keil C - Andy            01/01/70 00:00      
RE: Keil C - Peter            01/01/70 00:00      
RE: Keil C - Peter            01/01/70 00:00      
RE: Keil C - Michael            01/01/70 00:00      
RE: Keil C - Peter            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: Keil C - How to place Structure on Port            01/01/70 00:00      
RE: ANSI Bitfields            01/01/70 00:00      

Back to Subject List