Is it possible to immediately switch tasks from one to another irrespective of its task priorities?
I have been trying this since a week and what I found so far with
task notifications is
it acts as a flag set and data transmission wrt priorities
2)Event handler
This sets bits of event and in a group as well
in this regard,please guide me if there is any way to switch the tasks irrespective of its proirities…
**RTOS ver- 10.0.1
Board - ti-CC3200
Priorities are priorities: you can not tell the kernel to disregard them. When there is another higher-priority task in the running state, that task will get priority.
If you want a lower-priority task to become active immediately, make sure that all higher-priority tasks are in some blocking function, or you temporarily raise the priority of the task that you want to become active.
Task generally should block themselves, not be blocked by some outside agent. You can block them by using vTaskSuspend, but I would really not suggest using it for this.
If a task has suddenly been given a responsibility that means it is high priority, then change its priority, don’t try to play with suspending/resuming tasks yourself to force it to run.
I would say that needing to do this is also a likely sign that priorities/responsibilities weren’t well assigned to begin with (but will admit there could be cases where a priority change can make sense).
I don’t want to reallocate priorities which are set initially…
If you are suggesting me to make the task highest priority temporarily as Hein Tibosch said,
I am definitily gonna try that…
Praveen, it looks like you’re still missing some basic understanding of FreeRTOS.
Richard Barry suggests that when you want task X to run, give it the highest priority. There are API’s that let you change a task’s priority.
Richard Damon is trying to tell you that tasks should not run constantly, they do their thing and then block somehow, waiting for a queue, for a semaphore, for a task notification, or whatever. While being blocked, they allow lower-priotity tasks to run.
If you look around on freertos.org, I am sure that you will find some good tutorials about FreeRTOS and it’s possibilities.
Yes Hein,definitely…
I am going through freertos.org as I have started to implement free rtos in my project recently & so is this querry…
Hope vTaskPrioritySet( ) will work in this regard…
In every FreeRTOS project there must be one ( and no more ) file called FreeRTOSConfig.h. You maintain that file, and it belongs to the project. It is there where you can configure the behaviour of the kernel.