groufosse wrote on Wednesday, June 26, 2013:
I found it fairly straightforward to do, so you need to have used both tool sets to some degree already!
It’s really as simple as creating at least on task in FreeRTOS as the “visualState” handling task, and should be running at an interval appropriate the the events occurring in your application. Mine runs at 243ms. I pick task numbers that don’t occur at even intervals with others. 8~0
When created this task will handle the vS events generated by your state machine, or you can “throw” events. You’ll create a “vS User” module of C/C++ functions that are “action functions” that are called upon specific events occurring. Within these action functions are then perhaps calls into various FreeRTOS functions, such as queue creation, task creation, etc. For asynchronous messaging, I found the FreeRTOS queue mechanism very good and reliable.
The only other note of caution is adjusting stack sizes appropriately. if you get mysterious crashes (or, WDT timeouts as I use the WDT on mine) start looking to task sizes. Another is task pointers; find a method to track them as they can cause grief if not managed right (as you may already know)