feat(freertos/idf): Add taskVALID_CORE_ID() macro

This commit adds a taskVALID_CORE_ID() macro, similar to the one offered in
Amazon SMP FreeRTOS.

- Various functions have been updated to use that macro
- Removed some unecessary static asserts of CONFIG_FREERTOS_NO_AFFINITY and
added casting.
- Uncrustify changes
This commit is contained in:
Darian Leung
2023-11-09 13:02:56 +08:00
parent 035d5d17cf
commit c12da6b77d
4 changed files with 18 additions and 18 deletions

View File

@@ -204,6 +204,15 @@ typedef enum
#define tskNO_AFFINITY ( ( BaseType_t ) 0x7FFFFFFF )
/* Todo: Update tskNO_AFFINITY value to -1 (IDF-7908) */
/**
* Macro to check if an xCoreID value is valid
*
* @return pdTRUE if valid, pdFALSE otherwise.
*
* \ingroup Tasks
*/
#define taskVALID_CORE_ID( xCoreID ) ( ( ( ( ( BaseType_t ) xCoreID ) >= 0 && ( ( BaseType_t ) xCoreID ) < configNUMBER_OF_CORES ) || ( ( ( BaseType_t ) xCoreID ) == tskNO_AFFINITY ) ) ? pdTRUE : pdFALSE )
/**
*
* Macro for forcing a context switch.