-
Notifications
You must be signed in to change notification settings - Fork 706
【完善】FREERTOS 平台,使用句柄获取任务信息代替修改源码 #76
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -342,10 +342,23 @@ if (!(EXPR)) \ | |
| #elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_UCOSIII) | ||
| #include <os.h> | ||
| #elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_FREERTOS) | ||
| #include <FreeRTOS.h> | ||
| extern uint32_t *vTaskStackAddr(void);/* need to modify the FreeRTOS/tasks source code */ | ||
| extern uint32_t vTaskStackSize(void); | ||
| extern char * vTaskName(void); | ||
| #include <FreeRTOS.h> | ||
| #include <task.h> | ||
| typedef struct /* The old naming convention is used to prevent breaking kernel aware debuggers. */ | ||
| { | ||
| volatile StackType_t * pxTopOfStack; /*< Points to the location of the last item placed on the tasks stack. THIS MUST BE THE FIRST MEMBER OF THE TCB STRUCT. */ | ||
|
|
||
| #if ( portUSING_MPU_WRAPPERS == 1 ) | ||
| xMPU_SETTINGS xMPUSettings; /*< The MPU settings are defined as part of the port layer. THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */ | ||
| #endif | ||
|
|
||
| ListItem_t xStateListItem; /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */ | ||
| ListItem_t xEventListItem; /*< Used to reference a task from an event list. */ | ||
| 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 commentThe reason will be displayed to describe this comment to others. Learn more. Hi @fyyxxm, 这里的 |
||
| extern TaskHandle_t xTaskGetCurrentTaskHandle(void); | ||
| #elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTX5) | ||
| #include "rtx_os.h" | ||
| #else | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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();Uh oh!
There was an error while loading. Please reload this page.
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