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

Debug function can't work

I wan't toggle a pluse on P2.7
I've wrote a debug ini file to load in keil uVDebuger.
It compiled with no error.

but when i invoke one of the user function in command window error occured
: *** function 'IrKey', error 99, line 41: signal() already activated

my ini file list below,can anyone help?

SIGNAL void IrStart(void)
{
 P2&=0x7f;
 swatch(0.009);
 P2|=0x80;
 swatch(0.0045);
}

SIGNAL void IrDat0(void)
{
 P2&=0x7f;
 swatch(0.00056);
 P2|=0x80;
 swatch(0.000565);
}

SIGNAL void IrDat1(void)
{
 P2&=0x7f;
 swatch(0.00056);
 P2|=0x80;
 swatch(0.001685);
}

signal void IrStop(void)
{
 P2&=0x7f;
 swatch(0.00056);
 P2|=0x80;
 swatch(0.000565);
}

FUNC void IrKey(unsigned char key)
{
 unsigned char i;
 IrStart();
 for(i=0;i<8;i++)
     {if(key&0x7f)
         IrDat1();
      else IrDat0();
         key=key<<1;
     }
 IrStop();
}

Parents
  • It looks like IrDat0 or IrDat1 is still executing the second time you invoke them. I'm not exactly sure what line is line 41.

    You may need to use a delay between shifting out the bits in the IrKey function--which means IrKey must also be a signal.

    Also in IrKey, key&0x7F tells you if any bit but the MSB is set. Is this what you REALLY want?

    Jon

Reply
  • It looks like IrDat0 or IrDat1 is still executing the second time you invoke them. I'm not exactly sure what line is line 41.

    You may need to use a delay between shifting out the bits in the IrKey function--which means IrKey must also be a signal.

    Also in IrKey, key&0x7F tells you if any bit but the MSB is set. Is this what you REALLY want?

    Jon

Children
No data