Skip to content

Optimize log functions#304

Merged
matth-x merged 4 commits intomainfrom
fix/optimize-dbg-out
May 20, 2024
Merged

Optimize log functions#304
matth-x merged 4 commits intomainfrom
fix/optimize-dbg-out

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
@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