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

Add TaskStat::setOutput to dynamically switch output stream #2923

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Dec 12, 2024

This PR supports switching the output of TaskStat at runtime. This allows monitoring of freeRTOS task usage for esp32 devices. I use this to switch output between standard serial and USB serial.

Dynamically swap between consoles (serial, USB, etc.)
Copy link

what-the-diff bot commented Dec 12, 2024

PR Summary

  • Modification of TaskStat structure
    The construction process of TaskStat has been adjusted. It now stores a pointer to the Print object, not just a reference. This change impacts all relevant implementations.

  • Enhanced safety measures in update method
    To increase safety and stability, a null check for the out pointer has been integrated into the update method of TaskStat. This measure prevents any code from referencing a null pointer.

  • Syntax adjustments in out method calls
    All out methods calls have been updated to use pointer syntax (e.g., out->println()) rather than direct calls (e.g., out.println()).

  • Addition of new setOutput(Print& out) method
    A new method named setOutput(Print& out) has been introduced to the TaskStat class. This addition allows for changes in the output stream.

@slaff slaff added this to the 6.0.0 milestone Dec 13, 2024
@slaff slaff merged commit e21f8c7 into SmingHub:develop Dec 13, 2024
35 checks passed
@mikee47 mikee47 deleted the feature/taskstat-redirect branch December 13, 2024 11:05
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.

2 participants