Pumpkin, Inc.

Pumpkin User Forums

Is this wrong ?

If you have a general question or comment regarding Salvo, post it here.

Is this wrong ?

Postby seulater » Tue Apr 04, 2006 6:22 am

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).]

seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA

Re: Is this wrong ?

Postby aek » Tue Apr 04, 2006 8:01 am

Shouldn't be a problem ... which compiler?

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Is this wrong ?

Postby aek » Tue Apr 04, 2006 8:02 am

Oh, I see it -- OS_Delay(i) when i=0 is OS_Delay(0), which is OS_Stop().

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Is this wrong ?

Postby seulater » Tue Apr 04, 2006 8:36 am

>which compiler?
CrossWorks.

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

Thanks

seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA

Re: Is this wrong ?

Postby aek » Tue Apr 04, 2006 8:39 am

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.

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Is this wrong ?

Postby seulater » Tue Apr 04, 2006 8:46 am

Bingo!!

That worked.

Thanks so much!

seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron