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] [February 2014 Threads]
Why isn't portTASK_FUNCTION been used for the timerTask? The macro is used for the idleTask.
Those macros are not really used in practice. It seemed like a good idea at the time, but after the (probably hundreds) of combinations of compiler and architecture ports we found they were only actually needed on one occasions - and that was for something somewhat obscure.
Regards.
I used the macro to implement the IAR extension keyword __task.
IAR help:
This keyword allows functions to relax the rules for preserving registers. Typically, the keyword is used on the start function for a task in an RTOS.
By default, functions save the contents of used preserved registers on the stack upon entry, and restore them at exit. Functions that are declared __task do not save all registers, and therefore require less stack space.
Because a function declared __task can corrupt registers that are needed by the calling function, you should only use __task on functions that do not return or call such a function from assembler code.
The function main can be declared __task, unless it is explicitly called from the application. In real-time applications with more than one task, the root function of each task can be declared __task.
For the implementation I add a define in projdefs.h and portableIARMSP430Xportmacro.h.
projdefs.h:
#define TASKEXTENSIONKEYWORD _task
/*
* Defines the prototype to which task functions must conform. Defined in this
* file to ensure the type is known before portable.h is included.
*/
typedef TASKEXTENSIONKEYWORD void (*TaskFunctiont)( void * );
portmacro.h:
/* Task function macros as described on the FreeRTOS.org WEB site. */
#define portTASKFUNCTIONPROTO( vFunction, pvParameters ) TASKEXTENSIONKEYWORD void vFunction( void *pvParameters )
#define portTASKFUNCTION( vFunction, pvParameters ) TASKEXTENSION_KEYWORD void vFunction( void *pvParameters )
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.