概要
FreeRTOSのDebug, Utility系のTipsのまとめ
逐次追記、、予定
タスク情報関連
Task名の取得
void GetTaskStatus( const TaskHandle_t xHandle, TaskStatus_t* xTaskDetails )
{
//TaskHandle_t xHandle;
//TaskStatus_t xTaskDetails;
/* Obtain the handle of a task from its name. */
//xHandle = xTaskGetHandle( "Task_Name" );
/* Check the handle is not NULL. */
configASSERT( xHandle );
/* Use the handle to obtain further information about the task. */
vTaskGetTaskInfo( /* The handle of the task being queried. */
xHandle,
/* The TaskStatus_t structure to complete with information on xHandle. */
xTaskDetails,
/* Include the stack high water mark value in the TaskStatus_t
structure. */
pdTRUE,
/* Include the task state in the TaskStatus_t structure. */
eInvalid );
}
const char* GetTaskName( const TaskHandle_t xHandle)
{
TaskStatus_t xTaskDetails;
GetTaskStatus(xHandle, &xTaskDetails);
return xTaskDetails.pcTaskName;
}
// 使いたい場所で
// ex. printf("%s", GetTaskName(handle));