FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [May 2010 Threads] Using an ISR - Semaphore to unblock a taskPosted by stmiko on May 5, 2010 Hello,
I´ve got some "problems" with the named topic. I using a task to calculate some date which i get from an ISR. When the task is blocked with vTaskDelay it works without problems, but i want to start the task only when it get a ready state from the ISR. This is realized with xSemaphoreGiveFromISR() and in the task with an if - request and xSemaphoreTake(). The problem is, that i can´t stop this task, when it once jumped into the task, which uses the xSemaphoreTake(). In the ISR there is also a context switch with portEND_SWITCHING_ISR() because the unblocked task has the highest priority.
The second problem is, it seems, that after starting the scheduler he goes to the blocked task and don´t stop at the "if - semaphore - request"?
Does any know this problem? I using the Version 5.2.0 of FreeRTOS
Stephan
RE: Using an ISR - Semaphore to unblock a taskPosted by stmiko on May 5, 2010 Hello,
according to the first problem, i have found the reason. It has nothing to do with FreeRTOS... But how can i avoid, that the task will run one time after starting the scheduler?
RE: Using an ISR - Semaphore to unblock a taskPosted by Dave on May 5, 2010 Take the semaphore before entering the task loop. void atask( void *p ) { xSemaphoreTake(sem,0); // dont block
while(1) { xSemaphoreTake(sem,max_delay); // now you will block here because the semaphore is not available
// do something } }
RE: Using an ISR - Semaphore to unblock a taskPosted by stmiko on May 5, 2010 Thank you for this information, it works...
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|