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.

enter image description here

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.

  • Have you checked how tasks work under FreeRTOS and what information it can provide? Apr 30 '20 at 14:15
  • Tasks in FreeRTOS appear to be something different than what the OP is describing here. Apr 30 '20 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.