8000
Skip to content

[usb_uart] Fix uint32_t format specifier warning in pl2303 - #18310

Merged
swoboda1337 merged 1 commit into
devfrom
usb-uart-pl2303-format-warning
Aug 12, 2026
Merged

[usb_uart] Fix uint32_t format specifier warning in pl2303#18310
swoboda1337 merged 1 commit into
devfrom
usb-uart-pl2303-format-warning

Conversation

@bdraco
@bdraco bdraco commented Aug 12, 2026
Copy link
Copy Markdown
Member

What does this implement/fix?

Fixes a compiler warning in the PL2303 line coding debug log; baud is uint32_t but was printed with %u, so builds warn with -Wformat. This was fixed before in #17342 with PRIu32, then the log line was rewritten in #16990 and the specifier reverted, this restores it.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New developer-facing feature (adds functionality for component developers; no end-user configuration change)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — policy
  • Developer breaking change (an API change that could break external components) — policy
  • Undocumented C++ API change (removal or change of undocumented public methods that lambda users may depend on) — policy
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

  • fixes

Pull request in esphome.io with documentation (if applicable):

  • esphome/esphome.io#<esphome.io PR number goes here>

Pull request in developers.esphome.io with developer documentation (if applicable):

  • esphome/developers.esphome.io#<developers.esphome.io PR number goes here>

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040/RP2350
  • BK72xx
  • RTL87xx
  • LN882x
  • nRF52840

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@esphome
esphome Bot commented Aug 12, 2026
Copy link
Copy Markdown
Contributor

To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file:

external_components:
  - source: github://pr#18310
    components: [usb_uart]
    refresh: 1h

(Added by the PR bot)

@codecov
codecov Bot commented Aug 12, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.03%. Comparing base (cffd775) to head (94acba5).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #18310   +/-   ##
=======================================
  Coverage   88.03%   88.03%           
=======================================
  Files          65       65           
  Lines       14921    14921           
  Branches     2244     2244           
=======================================
  Hits        13136    13136           
  Misses       1473     1473           
  Partials      312      312           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bdraco
bdraco marked this pull request as ready for review August 12, 2026 04:48
@bdraco
bdraco requested a review from clydebarrow as a code owner August 12, 2026 04:48
Copilot AI lite review requested due to automatic review settings August 12, 2026 04:48
@esphome
esphome Bot commented Aug 12, 2026
Copy link
Copy Markdown
Contributor

👋 Hi there! I've automatically requested reviews from codeowners based on the files changed in this PR.

@clydebarrow - You've been requested to review this PR as codeowner(s) of 1 file(s) that were modified. Thanks for your time! 🙏

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Restores the correct uint32_t format specifier in the usb_uart PL2303 driver debug log to eliminate -Wformat compiler warnings when printing baud rate values.

Changes:

  • Updates the PL2303 SET_LINE_REQUEST debug log to print baud using PRIu32 instead of %u.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions
Copy link
Copy Markdown
Contributor

Memory Impact Analysis

Components: usb_uart
Platform: esp32-s3-idf

Metric Target Branch This PR Change
RAM 70,351 bytes 70,351 bytes ➡️ +0 bytes (0.00%)
Flash 282,643 bytes 282,659 bytes 📈 🔸 +16 bytes (+0.01%)

Note: This analysis measures static RAM and Flash usage only (compile-time allocation).
Dynamic memory (heap) cannot be measured automatically.
⚠️ You must test this PR on a real device to measure free heap and ensure no runtime memory issues.

This analysis runs automatically when components change. Memory usage is measured from a representative test configuration.

@swoboda1337
swoboda1337 merged commit 3c46cc9 into dev Aug 12, 2026
50 of 51 checks passed
@swoboda1337
swoboda1337 deleted the usb-uart-pl2303-format-warning branch August 12, 2026 14:59
@swoboda1337 swoboda1337 added this to the 2026.8.0 milestone Aug 12, 2026
@bdraco
bdraco commented Aug 13, 2026
Copy link
Copy Markdown
Member Author

thanks

@jesserockz jesserockz mentioned this pull request Aug 13, 2026
pull Bot pushed a commit to LeeHanYeong/esphome that referenced this pull request Aug 13, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0