![]() ![]() The task code function must have only one parameter (void* _params), but even function members that doesn’t receive parameters have one: the this pointer. Why so many problems for creating a task in C++? Can we just use a member function as the task parameter in the FreeRTOS API function xTaskCreate()? No, we can’t. Here we have the task code:Ĭhip_GPIO_SetPinToggle( LPC_GPIO, this->port, this->pin ) ![]() The object led1 has 128 words for its task’s stack runs at the lowest priority has «led» as its name it’s attached to port 0, pin 7 and will blink at 4 times per second. The first one shows you how to create the task, and the second one shows you how the task is coded. You can grasp the surface of this technique looking at the next two code excerpts. The goal of this post is to show how to create tasks in FreeRTOS with objects and classes, but without modifying such framework.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |