We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I was wondering what the "best" way to set a bit in a variable declared in the bit addressable area. Originally I declared each bit as an sbit and therefore can set and clear them as follows
uint8_t bdata status ; sbit enable = staus ^ 0 ; enable = 1 ; enable = 0 ;
#define ENABLE 0x01 uint8_t bdata status ; status |= ENABLE ; status &= ~ENABLE ;
"Maybe it has something to do with the way i have defined the variable." Or because you are using a C166 compiler as opposed to the (apparent) use of C51 by other posters. In fairness to everyone, your posts did not specify a product and I would hazard a guess that when none is specified, C51 is assumed.
"Or because you are using a C166 compiler as opposed to the (apparent) use of C51 by other posters." Which does, of course, beg the question: If C166 can do it, why can't (or doesn't) C51?
A: Because the C167 has a different output structure.