Skip to content

Conversation

@finger563
Copy link
Contributor

Description

Add new static APIs to espp::Task to query individual characteristics of the task or current task context

Motivation and Context

These APIs provide a more convenient way to access task information without needing to use the espp::TaskMonitor class or parse the espp::Task::get_info() string.

How has this been tested?

Build and run task/example on QtPy ESP32-S3 and verify the output matches expectations.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

Copilot AI review requested due to automatic review settings December 28, 2025 22:59
@finger563 finger563 self-assigned this Dec 28, 2025
@finger563 finger563 added enhancement New feature or request tasks labels Dec 28, 2025
@github-actions
Copy link

✅Static analysis result - no issues found! ✅

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds new static APIs to espp::Task for querying individual task characteristics, providing more convenient access to task information without needing to parse the get_info() string or use the TaskMonitor class.

Key Changes:

  • Added static methods to query specific task properties: get_freertos_handle(), get_priority(), get_high_water_mark(), and get_core_id() - each with both no-parameter (current context) and task-parameter overloads
  • Initialized task_handle_ to nullptr for safer default state
  • Updated example code to demonstrate the new APIs and modernized formatting from fmt::print to fmt::println

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
components/task/include/task.hpp Added new static API methods for querying task characteristics (FreeRTOS handle, priority, high water mark, core ID) with both current-context and task-specific overloads; initialized task_handle_ to nullptr
components/task/src/task.cpp Updated get_info() to use new get_core_id() helper and removed trailing newlines from format strings
components/task/example/main/task_example.cpp Added test coverage for new APIs and modernized all fmt::print calls to fmt::println

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@finger563 finger563 merged commit 6972195 into main Dec 28, 2025
101 of 102 checks passed
@finger563 finger563 deleted the feat/task-api-improvements branch December 28, 2025 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants