Skip to content
Snippets Groups Projects
Commit 0a74774a authored by Stefan Brüns's avatar Stefan Brüns Committed by Scott Lahteine
Browse files

soft_pwm: avoid useless refetches of pwm_count


The compiler is not able to reuse the value of pwm_count, but reloads it
on every evaluation, if is stored in a static variable, as it cannot prove
it will be unchanged. A variable with local scope may not be modified from
the outside, so its value can be reused.
Doing so reduces text size and instruction count.

Signed-off-by: default avatarStefan Brüns <stefan.bruens@rwth-aachen.de>
parent 35a55d57
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment