Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

Task Creation: Same Function Different Name

Posted by darkkingdom on November 4, 2015

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] )


Task Creation: Same Function Different Name

Posted by rtel on November 4, 2015

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


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner