mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 21:24:32 +02:00
freertos: added task state field inside of TaskSnapshot_t to capture it.
This commit is contained in:
@@ -199,6 +199,7 @@ typedef struct xTASK_SNAPSHOT
|
||||
StackType_t *pxTopOfStack; /*!< Points to the location of the last item placed on the tasks stack. */
|
||||
StackType_t *pxEndOfStack; /*!< Points to the end of the stack. pxTopOfStack < pxEndOfStack, stack grows hi2lo
|
||||
pxTopOfStack > pxEndOfStack, stack grows lo2hi*/
|
||||
eTaskState eState; /*!< Current state of the task. Can be running or suspended */
|
||||
} TaskSnapshot_t;
|
||||
|
||||
/**
|
||||
|
@@ -5057,6 +5057,7 @@ TickType_t uxReturn;
|
||||
}
|
||||
pxTaskSnapshotArray[ *uxTask ].pxTCB = pxTCB;
|
||||
pxTaskSnapshotArray[ *uxTask ].pxTopOfStack = (StackType_t *)pxTCB->pxTopOfStack;
|
||||
pxTaskSnapshotArray[ *uxTask ].eState = eTaskGetState(pxTCB);
|
||||
#if( portSTACK_GROWTH < 0 )
|
||||
{
|
||||
pxTaskSnapshotArray[ *uxTask ].pxEndOfStack = pxTCB->pxEndOfStack;
|
||||
|
@@ -27,6 +27,9 @@ TEST_CASE("Tasks snapshot", "[freertos]")
|
||||
esp_cpu_stall(other_core_id);
|
||||
#endif
|
||||
UBaseType_t task_num = uxTaskGetSnapshotAll(tasks, TEST_MAX_TASKS_NUM, &tcb_sz);
|
||||
for (uint32_t i = 0; i < task_num; i++) {
|
||||
TEST_ASSERT_EQUAL(tasks[i].eState, eTaskGetState(tasks[i].pxTCB));
|
||||
}
|
||||
#ifndef CONFIG_FREERTOS_UNICORE
|
||||
esp_cpu_unstall(other_core_id);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user