Pumpkin, Inc.

Pumpkin User Forums

Binary Semaphore TimeOUT

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Binary Semaphore TimeOUT

Postby neuralc » Mon Jul 29, 2002 2:00 am

Hi all,

I'm using a binary semaphore to signal a task using time out with it. The problem it's when the semaphore is leaved (when task is signaled or when occurs a time out) I use the OSGetStateTask() to verify the cause, but I get always the state of task running (either it's from a time out).

Some one have experienced a similar situation?


ThX

NeuralC

neuralc
 
Posts: 2
Joined: Sun Jul 28, 2002 11:00 pm

Re: Binary Semaphore TimeOUT

Postby aek » Mon Jul 29, 2002 8:25 am

Hello.

You must use OSTimedOut() to discern whether a task has timed out ... see User Manual for examples.

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

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

Re: Binary Semaphore TimeOUT

Postby neuralc » Tue Jul 30, 2002 4:14 am

Hi,

Seeking in the salvo.h We have found the following macro for OSTimedOut. But like this the result are always true, right?

#define OSTimedOut() OScTcbP->u.runStatus.state && OSTA_TIMEDOUT
I have changed to :

#define OSTimedOut() !(OScTcbP->u.runStatus.state ^ OSTA_TIMEDOUT)

and every thing works fine.


NeuralC

neuralc
 
Posts: 2
Joined: Sun Jul 28, 2002 11:00 pm

Re: Binary Semaphore TimeOUT

Postby aek » Tue Jul 30, 2002 9:13 am

Hello.

Aaaaah, you're running v2.x. Please upgrade to v3.0.x and you won't have this problem.

BTW, you should use

code:
#define OSTimedOut() !(OScTcbP->u.runStatus.state == OSTA_TIMEDOUT)

in v2.x. See Service Bulletin SB-6 in the Service Bulletin Forums.

But v2.x has some other problems, and so you should upgrade to v3.0.x.

Regards,

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

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


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 2 guests

cron