Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

fyyxxm
Copy link

@fyyxxm fyyxxm commented Oct 28, 2023

No description provided.

@fyyxxm
Copy link
Author

fyyxxm commented Oct 28, 2023

测试结果
测试通过

@armink
Copy link
Owner

armink commented Oct 29, 2023

是不是不同版本的 Free RTOS 方法也不一样?

@fyyxxm
Copy link
Author

fyyxxm commented Oct 29, 2023

是不是不同版本的 Free RTOS 方法也不一样?

我看了,V9到V10.51都是可以的。

@fyyxxm
Copy link
Author

fyyxxm commented Oct 29, 2023

可以好好测下。。。。

@armink
Copy link
Owner

armink commented Oct 29, 2023

以前的版本我也是测试过的,所以这块建议增加版本检测的宏

@Mexico-zyy-lost
Copy link

实测可用,不需要改ft源码了,感谢

@wdfk-prog
Copy link

  • 优秀,我之前移植FREERTOS也是要在源码中修改

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;

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();
Copy link

@gangli01 gangli01 May 12, 2024

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();

Copy link

@gangli01 gangli01 May 12, 2024

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

@armink armink closed this Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants