FreeRTOS good practices
Hello,
I don't really have a problem, but I'm asking myself questions and I didn't succeed in synthesizing them and find answers on Google.
Problem 1:
Several tasks want to use the same peripheral, lets say SPI bus for example. What is the best way to protect it.
Sol 1: Use mutex on SPI utilization
Sol2: Create a dedicated task to use SPI and tasks that want to use SPI add messages to a queue.
Problem 2:
I want to receive data from a bus, lets say UART, and process data in a task.
Sol 1: Fill a buffer in the RX callback and send a notification to the task to unlock and process the buffer (maybe unlock the task only when an end of frame is detected is better?)
Sol 2: Send the received character with notification value or queue and task is waiting for that and process that only when unlocked.
In my mind, both solutions works for my two problems, but I have no experience nor someone that taught me that so if you have some feedback or good practices, I will be so thankful!
Thank you,
Charles
