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. */
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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.