rtel wrote on Monday, December 20, 2010:
I have actually just written two new sections to the FreeRTOS tutorial book, one of which is specifically on the trace hook macros .
The best place to define hook macros, such as traceTASK_SWITCHED_OUT(), is in FreeRTOSConfig.h. That way the order in which macros are defined is guaranteed to be correct. If you are going to write complex macros then you can put them in their own header file, and include that header file from FreeRTOSConfig.h.
The task hook function is only really required if you want each task to execute a different function. If ever task is to execute the same function you can call the function directly from your definition fo traceTASK_SWITCHED_OUT().
See the following page for more examples (if you have not done so already):
http://www.freertos.org/rtos-trace-macros.html
Regards.