mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-07 17:08:49 +00:00
change(freertos/idf): Deprecate some FreeRTOS IDF addition functions
This commit deprecates xTaskGetAffinity(), xTaskGetCurrentTaskHandleForCPU() and xTaskGetIdleTaskHandleForCPU() APIs for IDF-FreeRTOS kernel. Instead, users are directed to use alternatives. All other components in IDF using these functions have been updated accordingly.
This commit is contained in:
@@ -107,7 +107,7 @@ typedef struct {
|
||||
static void task_report_corenum(void *arg)
|
||||
{
|
||||
report_corenum_info_t *info = (report_corenum_info_t*) arg;
|
||||
info->recorded_core_num = xTaskGetAffinity(NULL);
|
||||
info->recorded_core_num = xTaskGetCoreID(NULL);
|
||||
xTaskNotifyGive(info->parent_handle);
|
||||
vTaskSuspend(NULL);
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ static void test_pended_running_task(void *arg)
|
||||
// While tasks which do not have affinity to the current core are unblocked.
|
||||
for (int i = 0; i < TEST_PENDED_NUM_BLOCKED_TASKS; i++) {
|
||||
// Note: We use eBlocked instead of eReady due to a bug in eTaskGetState(). See (IDF-5543)
|
||||
if (xTaskGetAffinity(blkd_tsks[i]) == xPortGetCoreID()) {
|
||||
if (xTaskGetCoreID(blkd_tsks[i]) == xPortGetCoreID()) {
|
||||
TEST_ASSERT_EQUAL(eBlocked, eTaskGetState(blkd_tsks[i]));
|
||||
TEST_ASSERT_EQUAL(false, has_run[i]);
|
||||
} else {
|
||||
|
||||
@@ -119,7 +119,7 @@ static void unpinned_task(void *arg)
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, vTaskCoreAffinityGet(NULL));
|
||||
#else
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, xTaskGetAffinity(NULL));
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, xTaskGetCoreID(NULL));
|
||||
#endif
|
||||
#endif // !CONFIG_FREERTOS_UNICORE
|
||||
|
||||
@@ -136,7 +136,7 @@ static void unpinned_task(void *arg)
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, vTaskCoreAffinityGet(NULL));
|
||||
#else
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, xTaskGetAffinity(NULL));
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, xTaskGetCoreID(NULL));
|
||||
#endif
|
||||
#endif // !CONFIG_FREERTOS_UNICORE
|
||||
// Reenable scheduling/preemption
|
||||
|
||||
@@ -141,7 +141,7 @@ static void unpinned_task(void *arg)
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, vTaskCoreAffinityGet(NULL));
|
||||
#else
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, xTaskGetAffinity(NULL));
|
||||
TEST_ASSERT_EQUAL(tskNO_AFFINITY, xTaskGetCoreID(NULL));
|
||||
#endif
|
||||
#endif // !CONFIG_FREERTOS_UNICORE
|
||||
|
||||
@@ -162,7 +162,7 @@ static void unpinned_task(void *arg)
|
||||
#if CONFIG_FREERTOS_SMP
|
||||
TEST_ASSERT_EQUAL(1 << cur_core_num, vTaskCoreAffinityGet(NULL));
|
||||
#else
|
||||
TEST_ASSERT_EQUAL(cur_core_num, xTaskGetAffinity(NULL));
|
||||
TEST_ASSERT_EQUAL(cur_core_num, xTaskGetCoreID(NULL));
|
||||
#endif
|
||||
#endif // !CONFIG_FREERTOS_UNICORE
|
||||
// Reenable scheduling/preemption
|
||||
|
||||
Reference in New Issue
Block a user