Skip to content

Add public print method that takes va_list instead of a variable number of arguments #41

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pennam
Copy link
Contributor

@pennam pennam commented Jan 23, 2024

I was tryng to improve SE05X library and get rid of this buffer used only for debugging purpose. To this i wanted to reuse Arduino_DebugUtils library.

SE05X NXP internal library already has builtin debug macros and is written in C so i cannot directly call Arduino_DebugUtils.print function as macro substitution, but i need to create a wrapper CPP function with varargs that calls the Arduino_DebugUtils.print method.

What i've found out is that is not possible to call a function which takes a variable number of arguments and passes them to some other function (which takes a variable number of arguments) so the proposal to add a new method that takes va_list

Probably another option is to use a variadic function template or using __builtin_apply but i did not investigate them and i think the proposed option is more straightforward.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jan 23, 2024
Copy link

Memory usage change @ 1cd099e

Board flash % RAM for global variables %
arduino:avr:mega 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/Arduino_Debug_Basic
flash
% examples/Arduino_Debug_Basic
RAM for global variables
% examples/Arduino_Debug_Advance
flash
% examples/Arduino_Debug_Advance
RAM for global variables
%
arduino:avr:mega 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/Arduino_Debug_Basic<br>flash,%,examples/Arduino_Debug_Basic<br>RAM for global variables,%,examples/Arduino_Debug_Advance<br>flash,%,examples/Arduino_Debug_Advance<br>RAM for global variables,%
arduino:avr:mega,0,0.0,0,0.0,0,0.0,0,0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants