Page 1 of 1

Services affected by OSSignalSem inside interrupts

PostPosted: Mon Jul 03, 2006 9:38 am
by Darukur
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


Re: Services affected by OSSignalSem inside interrupts

PostPosted: Mon Jul 03, 2006 10:03 am
by aek
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.

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