Pumpkin, Inc.

Pumpkin User Forums

Services affected by OSSignalSem inside interrupts

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

Services affected by OSSignalSem inside interrupts

Postby Darukur » Mon Jul 03, 2006 9:38 am

I have Events signaled at interrupts and I set
OSCALL_OSSIGNALEVENT to OSFROM_ANYWHERE.
I also protect with "OS_Protect and OS_Unprotect" the OSSignalSem in the "background".
I want to know if ther is any other service that has to be protected by this metod.

------------------
the one that does not know what looks for does not understand what finds

the one that does not know what looks for does not understand what finds
Darukur
 
Posts: 12
Joined: Sun Jun 25, 2006 11:00 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Services affected by OSSignalSem inside interrupts

Postby aek » Mon Jul 03, 2006 10:03 am

What you are doing is correct.

Since PICC and PICC-18 are non-reentrant compilers, interrupts must be disabled before and re-enabled after any function that appears in multiple callgraphs (see the PICC/PICC-18 manuals).

So if you are calling OSSignalBinSem() from an ISR (foreground) and e.g. a task (background), then you need to wrap every instance of OSSignalBinSem() in the background with OSProtect() and OSUnprotect().

If OSSignalBinSem() is the only function that occurs in multiple callgraphs, then it's the only one that needs this protection.

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

-------
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 3 guests

cron