Pumpkin, Inc.

Pumpkin User Forums

Signalling Semaphore from ISR

If you're having difficulty with Salvo's configuration options, post it here.

Signalling Semaphore from ISR

Postby aek » Fri Dec 01, 2000 3:49 am

Your code looks fine.

Are you using the freeware libraries? If so, you can't signal from an ISR because the freeware libraries were compiled with the OSCALL_XYZ configuration options set to OSFROM_MAINLINE_ONLY.

In the full version, this is how you do it: You set OSCALL_OSSIGNALBINSEM to OSFROM_ISR_ONLY, and recompile. This removes the interrupt disabling and enabling from OSSignalBinSem(), which then allows you to call it without it re-enabling interrupts and therefore causing nested interrupts, which you don't want.

We are considering a new set of freeware libraries for v2.2, which will have all the OSSignalXyz() services compiled with OSFROM_ANYWHERE. This will allow you to call them from either mainline code or ISRs. The downside is that this takes more RAM ...

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

Re: Signalling Semaphore from ISR

Postby NoMore » Fri Dec 01, 2000 10:59 am

I want to create Binary Semaphore in the main and Signal it from an interrupt. Delays are not involved in my application. How can it be done, what options and settings does it require.


void main (void)
{
PR2 = TMR2_RELOAD;
T2CON = 0x4D;

OSInit();

TMR2IE = 1;
PEIE = 1;
OSEnableInts();

CreateBinSem (0, 0);

for ( ; ; ) OSSched ();
}


#pragma interrupt_level 0
void interrupt IntVector (void)
{
if (TMR2IE && TMR2IF)
{
TMR2IF = 0;

OSSignalBinSem (0);
}
}

[This message has been edited by NoMore (edited December 01, 2000).]

[This message has been edited by NoMore (edited December 01, 2000).]

NoMore
 
Posts: 11
Joined: Fri Dec 01, 2000 12:00 am

Re: Signalling Semaphore from ISR

Postby NoMore » Mon Dec 04, 2000 2:11 am

Obviously i need new v2.2 libraries asap so i can test my application in Salvo environment. And thanks a bunch for comprehensive answer. And keep it up, good work you're doing. Seems I'm gonna love this system.
NoMore
 
Posts: 11
Joined: Fri Dec 01, 2000 12:00 am


Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest

cron