Closed mbuesch closed 2 years ago
I resolved all review findings. I'll rebase this again after #106 has been resolved an pulled.
Rebased on top of latest main
and removed a couple of compiler warnings in non-avr mode.
Thanks again for your review. I addressed all your points.
Got the notification for your commit above this comment. I want to break a new release soon, with all your changes, but then I'll wait a bit, still?
Oh, I think any name is fine. Please pick the name you feel is best. Be it udebug
, ufmt
or anything else.
I agree that we should have a release asap. But, maybe we should include #109 in that release, too?
With that applied I think this is ready for another release.
Here you go: https://github.com/Rahix/avr-device/releases/tag/v0.4.0 :)
Avoid unnecessary mask and branch instructions.
The basic reasoning behind this is that all other flags in the
SREG
can be clobbered without ill effects. Therestore()
function is an optimization fence and the compiler is not allowed to make assumptions about memory orSREG
state after execution.This avoids an
and
and abreq
instruction or similar in every critical section.This is an API breakage that requires an incompatible version bump. Question: Should we return a struct instead of u8? That would give us the opportunity to change semantics without breaking API in the future.
I hope I got the
llvm_asm!
part ofrestore()
right. I didn't test it. What about removing allllvm_asm!
?