mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-18 18:40:13 +00:00
feat(freertos): Introduced new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES
This commit replaces the use of portNUM_PROCESSORS and configNUM_CORES macros in all of ESP-IDF. These macros are needed to realize an SMP scenario by fetching the number of active cores FreeRTOS is running on. Instead, a new Kconfig option, CONFIG_FREERTOS_NUMBER_OF_CORES, has been added as a proxy for the FreeRTOS config option, configNUMBER_OF_CORES. This new commit is now used to realize an SMP scenario in various places in ESP-IDF. [Sudeep Mohanty: Added new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES] Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
@@ -325,7 +326,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
|
||||
task_name = pthread_cfg->thread_name;
|
||||
}
|
||||
|
||||
if (pthread_cfg->pin_to_core >= 0 && pthread_cfg->pin_to_core < portNUM_PROCESSORS) {
|
||||
if (pthread_cfg->pin_to_core >= 0 && pthread_cfg->pin_to_core < CONFIG_FREERTOS_NUMBER_OF_CORES) {
|
||||
core_id = pthread_cfg->pin_to_core;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user