Page 1 of 1

Issue using OSDelay with OSWaitEFlag()

PostPosted: Thu May 24, 2007 10:06 am
by gcarrelli
I have changed my code from using OS_WaitBinSen to OS_WaitEFlag. I have now run in to a problem that causes a WDT reset due to a Stack corruption or system crash.

The problem occurrs if I use OSDelay () in a Task where I have waited for an EFlag. This problem did not happen when I used OSWait_BinSem.

It works for about 5 times through before crashing (the EFlag can be set about 5 times)
See Following code:

Task_X ()
{
for ( ; ; )
{
OS_WaitEFlag ( EFLAG_PF,0x01,OSANY_BITS,OSNO_TIMEOUT,Task_X1);
OSClrEFlag ( EFLAG_PF,BITS );
OS_Delay ( 100, Task_X1 );
}

void ISR (void)
{
OSSetEFlag ( EFLAG_PF, 0x01 );
}

Thanks.