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

Optimize log functions #304

Merged
merged 4 commits into from
May 20, 2024
Merged

Optimize log functions #304

merged 4 commits into from
May 20, 2024

Conversation

matth-x
Copy link
Owner

@matth-x matth-x commented May 20, 2024

Optimize the firmware footprint of the MO_DBG_X macros.

The MO_DBG_X functionality was implemented inside macros only. This approach leads to much duplicated code after preprocessing. This PR moves a large share of the MO_DBG_X functionality into actual C++ functions. A simple measurement for validation showed a significant firmware footprint decrease of ~30 kB.

If using a custom console integration (enabled via MO_CUSTOM_CONSOLE=1), the MO_CONSOLE_PRINTF macro also comes at a significant overhead. By moving the message buffer which is allocated on the heap into the data section, the firmware size decreases by further ~10 kB.

@matth-x matth-x merged commit 53465b4 into main May 20, 2024
5 checks passed
@matth-x matth-x deleted the fix/optimize-dbg-out branch May 20, 2024 19: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.

1 participant