Hi Zohar:
Please refer to the following example to use xSempaphoreGiveFromISR()
void vISR(void *pvParameters)
{
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
/*The event has occurr3d, use teh semaphore to unblock the task so the task can process the event*/
xSemaphoreGiveFromISR(xSemaphore, &HigherPriorityTaskWoken);
/* Clear the interrupt here */
/* */
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
/*Define a task that performs an action each time an interrupt occurs. */
void vATask(void * pvParameters)
{
/*it is assumed the semaphore has already been created outside of this task*/
for (;;)
{
/*wait for the next event*/
if ( xSemaphoreTake(xSemaphore, portMAX_DELAY) == pdTURE)
/* The event has occurred, process it here*/
......
/*Processing is complete, return to wait for the next event*/
}
}
Regards
Daniel