Page 1 of 1

Is this wrong ?

PostPosted: Tue Apr 04, 2006 6:22 am
by seulater
Can anyone tell me if putting OS_Delay(1) inside the loop is a bad thing to do?

when i did this it killed my app. when i comment out OS_Delay(1) in the loop the app runs just fine.

Did i vilolate somthing by doing this ?

code:
void Task_Two (void)
{
static int i;

for (;;)
{
for ( i=0;i < 5; i++)
{
OS_Delay(1);
}

b++; //Global variable
OS_Delay(1);
}
}



[This message has been edited by aek (edited April 04, 2006).]


Re: Is this wrong ?

PostPosted: Tue Apr 04, 2006 8:01 am
by aek
Shouldn't be a problem ... which compiler?

------------------


Re: Is this wrong ?

PostPosted: Tue Apr 04, 2006 8:02 am
by aek
Oh, I see it -- OS_Delay(i) when i=0 is OS_Delay(0), which is OS_Stop().

------------------


Re: Is this wrong ?

PostPosted: Tue Apr 04, 2006 8:36 am
by seulater
>which compiler?
CrossWorks.

its not OS_Delay(i), rather OS_Delay(1)

Thanks


Re: Is this wrong ?

PostPosted: Tue Apr 04, 2006 8:39 am
by aek
Oh, sorry, my bad.

Make sure you're following this: http://www.pumpkininc.com/ubb/Forum19/HTML/000027.html . Assuming you are, that shouldn't be a problem.

------------------


Re: Is this wrong ?

PostPosted: Tue Apr 04, 2006 8:46 am
by seulater
Bingo!!

That worked.

Thanks so much!