-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Resolution: Won't DoThis will not be worked onThis will not be worked onStatus: DoneIssue is done internallyIssue is done internallyType: Bugbugs in IDFbugs in IDF
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
v5.5-8410210c-v2
Espressif SoC revision.
ESP32-D0WD-V3 (revision v3.1)
Operating System used.
Windows
How did you build your project?
Other (please specify in More Information)
If you are using Windows, please specify command line type.
None
Development Kit.
Freenove ESP32
Power Supply used.
USB
What is the expected behavior?
0 is returned, but I want to get the correct value.
Code
void setup() {
Serial.begin(115200);
}
void loop() {
TaskHandle_t h = xTaskGetCurrentTaskHandle();
printf("name=%s\n", pcTaskGetName(h));
UBaseType_t taskNumber = uxTaskGetTaskNumber(h);
printf("taskNumber=%u\n", taskNumber);
TaskStatus_t info = {};
vTaskGetInfo(h, &info, pdTRUE, eInvalid);
printf("info.name=%s\n", info.pcTaskName ? info.pcTaskName : "(null)");
printf("info.taskNumber=%u\n", info.xTaskNumber);
delay(1000);
}
Output
name=loopTask
taskNumber=0
info.name=loopTask
info.taskNumber=8
The result of uxTaskGetTaskNumber is strange.
What is the actual behavior?
I want the same number as vTaskGetInfo to be returned.
name=loopTask
taskNumber=8
info.name=loopTask
info.taskNumber=8
Steps to reproduce.
Code
void setup() {
Serial.begin(115200);
}
void loop() {
TaskHandle_t h = xTaskGetCurrentTaskHandle();
printf("name=%s\n", pcTaskGetName(h));
UBaseType_t taskNumber = uxTaskGetTaskNumber(h);
printf("taskNumber=%u\n", taskNumber);
TaskStatus_t info = {};
vTaskGetInfo(h, &info, pdTRUE, eInvalid);
printf("info.name=%s\n", info.pcTaskName ? info.pcTaskName : "(null)");
printf("info.taskNumber=%u\n", info.xTaskNumber);
delay(1000);
}
Debug Logs.
Diagnostic report archive.
No response
More Information.
xTaskGetCurrentTaskHandle
| pxTCB = xTask; |
vTaskGetInfo
| pxTCB = prvGetTCBFromHandle( xTask ); |
Metadata
Metadata
Assignees
Labels
Resolution: Won't DoThis will not be worked onThis will not be worked onStatus: DoneIssue is done internallyIssue is done internallyType: Bugbugs in IDFbugs in IDF