Skip to content

fix(serial): forward va_list to Print::vprintf - #3071

Open
chinderdelis wants to merge 1 commit into
BruceDevices:devfrom
chinderdelis:usbserial-vprintf-fix
Open

chinderdelis wants to merge 1 commit into
BruceDevices:devfrom
chinderdelis:usbserial-vprintf-fix

Conversation

@chinderdelis

Copy link
Copy Markdown

Proposed Changes

USBSerial::vprintf() forwarded its va_list as a variadic argument to Print::printf(). A va_list cannot be passed through ..., so formatted CLI output printed the address of the argument list instead of the values, e.g.:

led rgb 255 0 0 → LED color set to 3FCD8C30

Use the existing Print::vprintf() instead, which consumes the va_list correctly. BLESerialService::vprintf() already does the right thing.

Types of Changes

Bugfix

Verification

  • Freenove FNK0104AB: led rgb 255 0 0 now prints LED color set to FF0000.
  • Other serialDevice->printf-style output (RGB LED color, etc.) prints values instead of addresses.

Testing

Hardware tested on Freenove FNK0104AB.

Linked Issues

N/A

User-Facing Change

Fix serial CLI output printing memory addresses instead of formatted values.

Further Comments

N/A

USBSerial::vprintf() passed the va_list as a variadic argument to printf(), so formatted CLI output printed memory addresses instead of values. Forward it to vprintf().

This branch has not been deployed

No deployments
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.

1 participant