FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2015 Threads]
I did two or more task creation with same taskfunction and different taskname for xTaskCreate();.
And it seems work OK. But I wonder is it OK or are there any potential bugs.
For example.
void TestTask(void *pvParameters)
{
xxxxxxxxxxxxxxx
}
xTaskCreate(
TestTask,"TASK0",256,(VOID*)&MSGOBJECT[0],1,(xTaskHandle*)&task_handle[0]
);
xTaskCreate(
TestTask,"TASK1",256,(VOID*)&MSGOBJECT[1],1,(xTaskHandle*)&task_handle[1]
)
Each task has its own stack and its own (virtual) set of processor registers - so provided you are not using function scope static variables, what you are doing is fine, and in fact common practice. You can see an example here where three simple LED flash tasks are created from the same function - and the function. The LED to flash could have been passed into the task function using the function parameter: https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Demo/Common/Minimal/flash.c
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.