freertos: Fix various build errors

This commit fixes various build errors in IDF (and tests) when compiling
with SMP FreeRTOS:

- Updated usage of xTaskGetIdleTaskHandle()
- Disable sysview tracing macros
- Update some task snapshot functions
- Disabled test_freertos_hooks.c test as vApplicationIdleHook() and
  vApplicationTickHook() are used.
This commit is contained in:
Darian Leung
2022-02-25 22:32:46 +08:00
parent 9da5d7c40a
commit 883da858b0
4 changed files with 74 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
@@ -17,7 +23,12 @@ void test_task_get_state(void* arg)
//Current task should return eRunning
TEST_ASSERT(eTaskGetState(xTaskGetCurrentTaskHandle()) == eRunning);
//Idle task of current core should return eReady
#ifdef CONFIG_FREERTOS_SMP
TaskHandle_t *idle_handle_list = xTaskGetIdleTaskHandle();
TEST_ASSERT_EQUAL(eReady, eTaskGetState(idle_handle_list[xPortGetCoreID()]));
#else
TEST_ASSERT(eTaskGetState(xTaskGetIdleTaskHandle()) == eReady);
#endif
//Blocked Task should return eBlocked
TEST_ASSERT(eTaskGetState(blocked_task_handle) == eBlocked);
//Suspended Task should return eSuspended