Quality RTOS & Embedded Software

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


Includes in portable.h

Posted by ulmus on September 8, 2011
Can anyone cen help me and tell where 'MPLAB_PIC32MX_PORT' is defined?
I have searched everything i think, but couldnt find how is 'portmacro.h' included???

RE: Includes in portable.h

Posted by Richard on September 8, 2011
Older demos used the mechanism of defining a port specific constant, such as MPLAB_PIC32MX_PORT, to allow portable.h to then include the correct portmacro.h file. When this scheme is used, the definition is part of the project file. In the case of MPLAB, to find or create the definition, you would have to use the MPLAB IDE menus to bring up the project options, then go to the preprocessor definitions section, and just add MPLAB_PIC32MX_PORT as a definition.

However, newer demo projects no longer use this mechanism, as it become unwieldy with so many ports. Portable.h has changed in recent versions to include the following lines after all the conditional includes of portmacro.h:

/* Catch all to ensure portmacro.h is included in the build.  Newer demos
have the path as part of the project options, rather than as relative from
the project location. If portENTER_CRITICAL() has not been defined then
portmacro.h has not yet been included - as every portmacro.h provides a
portENTER_CRITICAL() definition. Check the demo application for your demo
to find the path to the correct portmacro.h file. */
#ifndef portENTER_CRITICAL
#include "portmacro.h"

That means that, to include the correct portmacro.h header file, you simply add the path to the header file to the existing include path list.


RE: Includes in portable.h

Posted by ulmus on September 8, 2011
Oh, so many many thanx to you!!!
I haven't noticed those lines :(

[ 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.


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


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