From 61df9abef9f2ee1217ac079c53648c0daad66667 Mon Sep 17 00:00:00 2001 From: agarratt Date: Thu, 20 Jun 2024 16:50:23 +0200 Subject: [PATCH] The dsPIC_MPLAB demo project now compiles under MPLAB X v6.20 using xc16 compilers --- include/FreeRTOS.h | 6 ++++++ portable/MPLAB/PIC24_dsPIC/portmacro.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index 4b59512c9..7810b29d4 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -29,6 +29,12 @@ #ifndef INC_FREERTOS_H #define INC_FREERTOS_H +/* + * On Microchip xc16 target there will be undefined reference to _Nop + * xc.h is supplied by Microchip and defines Nop + */ +#include + /* * Include the generic headers required for the FreeRTOS port being used. */ diff --git a/portable/MPLAB/PIC24_dsPIC/portmacro.h b/portable/MPLAB/PIC24_dsPIC/portmacro.h index fbac471d5..9e1e3edf7 100644 --- a/portable/MPLAB/PIC24_dsPIC/portmacro.h +++ b/portable/MPLAB/PIC24_dsPIC/portmacro.h @@ -54,7 +54,10 @@ #define portSTACK_TYPE uint16_t #define portBASE_TYPE short #define portPOINTER_SIZE_TYPE size_t +/* Microchip xc16 compilers already define SIZE_MAX in stdint.h */ +#ifndef SIZE_MAX #define SIZE_MAX ( ( size_t ) -1 ) +#endif typedef portSTACK_TYPE StackType_t; typedef short BaseType_t;