test: Fix some unused identifier warnings

This commit is contained in:
Anton Maklakov
2018-12-05 20:22:25 +08:00
parent 0652a4b714
commit 81bf07ed4d
6 changed files with 13 additions and 24 deletions

View File

@@ -7,6 +7,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "unity.h"
#include "sdkconfig.h"
#define TEST_MAX_TASKS_NUM 32
@@ -15,16 +16,18 @@ TEST_CASE("Tasks snapshot", "[freertos]")
{
TaskSnapshot_t tasks[TEST_MAX_TASKS_NUM];
UBaseType_t tcb_sz;
#ifndef CONFIG_FREERTOS_UNICORE
int other_core_id = xPortGetCoreID() == 0 ? 1 : 0;
#endif
// uxTaskGetSnapshotAll is supposed to be called when all tasks on both CPUs are
// inactive and can not alter FreeRTOS internal tasks lists, e.g. from panic handler
unsigned state = portENTER_CRITICAL_NESTED();
#if CONFIG_FREERTOS_UNICORE == 0
#ifndef CONFIG_FREERTOS_UNICORE
esp_cpu_stall(other_core_id);
#endif
UBaseType_t task_num = uxTaskGetSnapshotAll(tasks, TEST_MAX_TASKS_NUM, &tcb_sz);
#if CONFIG_FREERTOS_UNICORE == 0
#ifndef CONFIG_FREERTOS_UNICORE
esp_cpu_unstall(other_core_id);
#endif
portEXIT_CRITICAL_NESTED(state);