Sign in

username:

password:



Not a member?

Search AT91SAM



Search tips

Subscribe to AT91SAM



Ads

Discussion Groups

See Also

DSPFPGAElectronics

Advertise Here

For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU. This group is to exchange information to help users get started and learn how to use the devices.

Semaphore - eran...@gmail.com - Nov 4 4:28:13 2008

Hi all,

In my application i have an IRQ on IRQ0 and two more taskes.
I would like to create a semaphore that indicates when i receive an interrupt.
I create a semaphore and use these function call in:

In the IRQ function: OSSemPost(AlEvent);
In the Task function: OSSemPend(AlEvent,0,&ErrAlSem);

I try to figure how to use these function, becuse I never success to restore the calling to the task that use the semaphor again.

Please Advice.

Here is the code decleration:

void AppTaskIRQEvent_func(void)
{
while (1)
{
OSSemPend(AlEvent,0,&ErrAlSem);
if(ErrAlSem == OS_ERR_NONE)
{
DO SOMTHING
}
}
}

void IRQ0_ISR(void)
{
OSSemPost(AlEvent);
//OSSemAccept(AlEvent);
if(ErrAlSem != OS_ERR_NONE)
{
rprintf("%s(%d): EtherCAT OsSemSet failed - %d\n", __FUNCTION__, __LINE__, ErrPart);
return;
}
}

AlEvent = OSSemCreate(1);

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



(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )