You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only the bit for the pin to be toggled should be set in the PIN
register. The RMW-operation was incorrect here as it would also toggle
unrelated pins which happen to read HIGH at that moment.
This went unnoticed because the code for the non-dynamic pin-variant was
optimized down to an `sbi` instruction - thus "accidentally" behaving
correctly.
I do not think it is a good idea to rely on this behavior though. If
the non-dynamic code should be optimized to an `sbi` again at some point
in the future, I would prefer an implementation using inline assembly.
Ref: #284
0 commit comments