This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do I get the bit address in Keil C

Hi,

I want to know the address of a bit variable.
For example:

bit gBit;
func()
{
  printf("%d", &gBit);
}
How do I know where the variable gBit is allocated by the linker in run time?

Parents
  • This is what I am trying to do

    foo()
    {
      bit	Finish = FALSE;
    
      //pass the bit address to interrupt service routine(ISR)
      //the ISR routine will set this bit to TRUE when some event occurs
      Reg2ISR(&Finish);
    
      while( !Finish ) //waiting for the ISR routine to set this bit to true
        ;
    }
    
    Each bit in the bit addressable area has an address, ranging from 0x00 to 0x7F. As long as I can get this address, I can assign value to the bit of that address.

Reply
  • This is what I am trying to do

    foo()
    {
      bit	Finish = FALSE;
    
      //pass the bit address to interrupt service routine(ISR)
      //the ISR routine will set this bit to TRUE when some event occurs
      Reg2ISR(&Finish);
    
      while( !Finish ) //waiting for the ISR routine to set this bit to true
        ;
    }
    
    Each bit in the bit addressable area has an address, ranging from 0x00 to 0x7F. As long as I can get this address, I can assign value to the bit of that address.

Children