Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Task function macro for timer task

Posted by blacknine on February 21, 2014

Why isn't portTASK_FUNCTION been used for the timerTask? The macro is used for the idleTask.


Task function macro for timer task

Posted by rtel on February 21, 2014

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.


Task function macro for timer task

Posted by blacknine on February 24, 2014

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 )


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists