-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【完善】FREERTOS 平台,使用句柄获取任务信息代替修改源码 #76
Conversation
是不是不同版本的 Free RTOS 方法也不一样? |
我看了,V9到V10.51都是可以的。 |
可以好好测下。。。。 |
以前的版本我也是测试过的,所以这块建议增加版本检测的宏 |
实测可用,不需要改ft源码了,感谢 |
|
UBaseType_t uxPriority; /*< The priority of the task. 0 is the lowest priority. */ | ||
StackType_t * pxStack; /*< Points to the start of the stack. */ | ||
char pcTaskName[ configMAX_TASK_NAME_LEN ]; /*< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ | ||
} tskTCB_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fyyxxm, 这里的tskTCB_t
和task.c中tskTCB_t
并没有完全对齐,如果FreeRTOSConfig.h中使能了更多的feature, 两边的结构体就会不一致,是不是存在解析错位的风险?
@@ -241,7 +242,8 @@ static const char *get_cur_thread_name(void) { | |||
|
|||
return (const char *)OSTCBCurPtr->NamePtr; | |||
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_FREERTOS) | |||
return vTaskName(); | |||
tskTCB_t * task_handle = (tskTCB_t *)xTaskGetCurrentTaskHandle(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是否可以使用TaskHandle_t
替换tskTCB_t *
。
TaskHandle_t task_handle = xTaskGetCurrentTaskHandle();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我尝试这样修改,存在”struct tskTaskControlBlock“未定义的问题。
我改用traceRETURN_xTaskGetCurrentTaskHandle来实现,
#82
No description provided.