Pumpkin User Forums
  Configuration
  Signalling Semaphore from ISR

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Signalling Semaphore from ISR
NoMore
Junior Member
posted December 04, 2000 02:11     Click Here to See the Profile for NoMore     Edit/Delete Message   Reply w/Quote
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.

IP: 193.124.228.35

aek
Moderator
posted December 01, 2000 15:49     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
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 ...

IP: 63.203.232.106

NoMore
Junior Member
posted December 01, 2000 10:59     Click Here to See the Profile for NoMore     Edit/Delete Message   Reply w/Quote
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).]

IP: 193.124.228.35

All times are ET

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Pumpkin Home Page

©2000-2008 Pumpkin, Inc. All Rights Reserved. Pumpkin and the Pumpkin logo, Salvo and the Salvo logo, The RTOS that runs in tiny places, CubeSat Kit and the CubeSat Kit logo are all trademarks of Pumpkin, Inc. All other trademarks are the properties of their respective owners.


Ultimate Bulletin Board 5.46a