From 2537dd8ecab730c34f60364c1485a0b354d6a2fe Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Wed, 23 Nov 2022 16:41:51 +0800 Subject: [PATCH] freertos(IDF): Add preprocessor check for configNUM_CORES configuration This commit adds preprocessing time checks to ensure that - configNUM_CORES is defined to 1 or 2 - Incompatible configurations are not set depending on configNUM_CORES --- .../FreeRTOS-Kernel/include/freertos/FreeRTOS.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h b/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h index bd83336fd8..4df12a4031 100644 --- a/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h +++ b/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h @@ -98,6 +98,14 @@ #error configMAX_PRIORITIES must be defined to be greater than or equal to 1. #endif +#ifndef configNUM_CORES + #error Missing definition: configNUM_CORES must be defined in FreeRTOSConfig.h +#endif + +#if ( ( configNUM_CORES != 1 ) && ( configNUM_CORES != 2 ) ) + #error configNUM_CORES must be defined to either 1 or 2. +#endif + #ifndef configUSE_PREEMPTION #error Missing definition: configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details. #endif @@ -972,6 +980,10 @@ #error configUSE_MUTEXES must be set to 1 to use recursive mutexes #endif +#if ( ( configNUM_CORES > 1 ) && ( configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 ) ) + #error configUSE_PORT_OPTIMISED_TASK_SELECTION is not supported if configNUM_CORES > 1 +#endif + #ifndef configINITIAL_TICK_COUNT #define configINITIAL_TICK_COUNT 0 #endif