Best way to use FreeRTOS message system

davedoors wrote on Wednesday, October 22, 2008:

Without examining too much a couple of points.

Be careful passing a pointer to a stack variable. In this case it is fine as the variable remains valid until after you have waited for the result.

You are polling for the result which will only work in the task processing the message has a higher priority than the task running this code. Consider using a blocking mechanism like a semaphore, that will put task to sleep until there is actually some processing to do. That would be much more efficient.