Pumpkin, Inc.

Pumpkin User Forums

OSTimedOut() problem

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

OSTimedOut() problem

Postby aek » Wed Jun 16, 2004 12:53 am

Hello.

Pumpkin is closed for Holidays this June, but I happened to see this, so I'll respond.

I think something else is wrong -- OSTimedOut() will only be true if the OS_WaitBinSem() times out -- the OS_WaitMsg() should have no effect on timeouts.

Are you sure you ar calling OSTimer() at the correct rate? If you're (unintentionally) calling OSTimer() much too rapidly (e.g. at 10kHz or faster), that may cause the same problem.

If you continue to have this problem, you can email suport with a sample project -- but we won't be able to respond before July. Sorry.

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

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

Re: OSTimedOut() problem

Postby Tkk » Wed Jun 16, 2004 1:20 am

I have problems with timeouts when i used two waiting events that are meant to run one after another in the same task like this.


OS_WaitMsg(MSG_COMMAND, &msgP, OSNO_TIMEOUT, TaskReceive1);

data = *(char *)msgP;

OS_WaitBinSem(BINSEM_RX_BUF,10,TaskReceive2);

if( OSTimedOut() )
{
// do something
}

When BINSEM_RX_BUF semafore has arrived the ostimedout is allways true regardless of the time passed.

I used SALVO LITE version and HI-TECH compiler.

regards,

Teijo

Tkk
 
Posts: 6
Joined: Tue Jun 15, 2004 11:00 pm
Location: Oulu, Finland

Re: OSTimedOut() problem

Postby aek » Wed Jun 16, 2004 8:08 am

It also occurred to me that if you failed to set OSEVENTS properly in salvocfg.h, or the calls to OSCreateBinSem() and/or OSSignalBinSem() failed (did you check their return codes?), then you'll also see the behavior you describe ...

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

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

Re: OSTimedOut() problem

Postby Tkk » Wed Jun 16, 2004 10:50 am

Thanks for the information. I create another test project and it works. I'll check your suggestions.

Have a nice holiday.

Best regards,

Teijo

Tkk
 
Posts: 6
Joined: Tue Jun 15, 2004 11:00 pm
Location: Oulu, Finland


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron