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 )