diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index 16c7c4bc87..683ea02ac0 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -10,6 +10,12 @@ config FREERTOS_UNICORE This is needed when e.g. another process needs complete control over the second core. +# This invisible config value sets the value of tskNO_AFFINITY in task.h. +# Intended to be used as a constant from other Kconfig files. +# Value is (32-bit) INT_MAX. +config FREERTOS_NO_AFFINITY + hex + default 0x7FFFFFFF choice FREERTOS_CORETIMER prompt "Xtensa timer to use as the FreeRTOS tick source" diff --git a/components/freertos/include/freertos/task.h b/components/freertos/include/freertos/task.h index 31df0bdd10..441ed90816 100644 --- a/components/freertos/include/freertos/task.h +++ b/components/freertos/include/freertos/task.h @@ -93,6 +93,9 @@ extern "C" { #define tskKERNEL_VERSION_MINOR 2 #define tskKERNEL_VERSION_BUILD 0 +/** + * @brief Argument of xTaskCreatePinnedToCore indicating that task has no affinity + */ #define tskNO_AFFINITY INT_MAX /** diff --git a/components/freertos/port.c b/components/freertos/port.c index 98fe13d364..4c99b1936b 100644 --- a/components/freertos/port.c +++ b/components/freertos/port.c @@ -123,6 +123,8 @@ extern void _xt_coproc_init(void); #define SYSTICK_INTR_ID (ETS_INTERNAL_TIMER1_INTR_SOURCE+ETS_INTERNAL_INTR_SOURCE_OFF) #endif +_Static_assert(tskNO_AFFINITY == CONFIG_FREERTOS_NO_AFFINITY, "incorrect tskNO_AFFINITY value"); + /*-----------------------------------------------------------*/ unsigned port_xSchedulerRunning[portNUM_PROCESSORS] = {0}; // Duplicate of inaccessible xSchedulerRunning; needed at startup to avoid counting nesting