Quality RTOS & Embedded Software

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




Loading

portTASK_FUNCTION_PROTO macro and PIC32MX

Posted by https://www.google.com/accounts on October 26, 2009
I was wondering if anyone has any insight as to the reason the portTASK_FUNCTION_PROTO/portTASK_FUNCTION_PROTO macros were not used in the PIC32MX port? It was used in the PIC18 port. I know this is more of a purist question than one of style. My assumption is that the author of the port simply did not feel the macro necessary. I have found that it works and included it in my demo branch (for learning reasons only).

Thanks,

Dave

RE: portTASK_FUNCTION_PROTO macro and PIC32MX

Posted by Richard on October 26, 2009
The macros can be used to add compiler key word extensions to task functions with the aim of reducing their stack usage (basically because they never return). This is generally only useful on really small micros with very limited RAM.

How have you implemented the macros?

Regards.

RE: portTASK_FUNCTION_PROTO macro and PIC32MX

Posted by https://www.google.com/accounts on October 27, 2009
Hi Richard,

I can send you the entire project (although I doubt that's what you want), here is a quick summary:

First I modified the function prototypes for the two tasks, to validate the
changes:


//dmc static void prvTestTask1( void *pvParameters );
static portTASK_FUNCTION_PROTO(prvTestTask1, prvParameters);
//dmc static void prvTestTask2( void *pvParameters );
static portTASK_FUNCTION_PROTO(prvTestTask2, prvParameters);

And then the function definitions as:
static portTASK_FUNCTION(prvTestTask1, pvParameters)
//static void prvTestTask1( void *pvParameters )
{
...
}

and
static portTASK_FUNCTION(prvTestTask2, pvParameters)
//static void prvTestTask2( void *pvParameters )
{
...
}

To be comlete, I have not tested the parameters, but don't see any issues...do you?

I am using the demo on the PIC32MX/PIC32MX USB starter kits. I haven't ported the USB driver (in the spirit of the Microchip Application note you mention on your web site) and probably won't. My goal for now is to impliment a variation of the MRF24J40 Radio Utility Driver Program and develop a wireless application for the PIC32 under FreRTOS.

Dave

RE: portTASK_FUNCTION_PROTO macro and PIC32MX

Posted by https://www.google.com/accounts on October 27, 2009
And I should probably mention that the macro definitions (included with the port in the MPLAB PIC32MX portmacro.h file (per the distribution) are:
/* Task function macros as described on the FreeRTOS.org WEB site. */
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) __attribute__((noreturn)#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )

i.e., no changes from the demo as unziped from FreeRTOS 6.0.0.

BTW, my appologies for the text formatting. Need to learn about the Markdown syntax.

Dave


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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