Event based task execution

Hi,

I have three tasks created. Two of the task is executing alternatively but I wanted to run the third task to execute only if a particular bit is set. Is there any way to run a task created in freertos only if a particular event has occurred?

Hello @Devaharsha, are you already familiar with FreeRTOS and especially with its various synchronization or signaling features like task notifications, semaphores, messages queues, etc ?
Usually a task doesn’t just run. Instead it’s waiting for a certain event, execute the corresponding action and waits again for the next thing to do.
There are many ways to implement this behavior using one of the signaling mechanisms mentioned above.

This is my understanding - If a task has been created using xTaskCreate and when the compiler read xTaskSchedule, the pointer points to the function name that the task has created. It executes it until TaskDelay or Sleep is used. If its wrong, can you tell the where I am going wrong?
Theoretically, I know what semaphores, and mutex are. But I haven’t implemented it.
But what is a Task notification? Can you explain?

… not exactly - the compiler doesn’t read xTaskSchedule.
I’d recommend to browse the comprehensive docs here

and also here RTOS - Free professionally developed and robust real time operating system for small embedded systems development
to get a better overview first.
There all the features are documented, explained with code examples.
This will help you a lot !

1 Like