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

Feature: individual STM32 timer oc mode calls #1500

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dragonmux
Copy link
Contributor

When implementing a new feature in Black Magic Debug to soft-start the target power output, we wound up having too interact with the timers and set up the output compare block mode for a channel. This pulls in an extra ~400 bytes of code due to the complex unoptimisable nature of the switch-case-in-switch-case setup of the STM32 timer_set_oc_mode() function.

This PR addresses some of this by splitting out the case logic of the outer switch-case into per-channel functions (still exposed by this unified mode set function), saving around 332 bytes when only a single channel is used. It otherwise maintains the exact same logic and call structure for existing code.

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.

None yet

1 participant