I am going to use the FreeRTOS on my hardware platform. My plan is to model individual tasks as C structs containing task execution period, task priority, task stack size, task name and maybe another atributes. Then I am going to define public “constructor” function called task accepting values of individual task attributes mentioned above, “abstract” function called taskFun which contains code of the task (each task will have this function but the implementation will differ among all the tasks) and public set/get functions.
My motivation for development of such overhead is improving organization of the source code and data encapsulation. My goal is to have a sort of layered architecture where the top view offers only information about number of tasks and their execution periods and so on. The more detailed information regarding what is executed with which period and priority is hidden in the taskFun function.
Do you think it is good a idea? What are better approaches in case C language is used? Thanks for any ideas.