Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #91.
Abstract
Starting from 1.59.0, rustc has been removed support for the
llvm_asm!()
macro, making it impossible to useavr-device
with newer compilers.This merge requests adjusts the code, so that it continues to use
llvm_asm!()
on older compilers (such as the infamousnightly-2021-01-07
), but switches toasm!()
on the newer ones.Due Diligence
I've checked the code on
nightly-2021-01-07
and a custom-builtrustc
from around yesterday (b759b2218649016cc40e82bdd6d958e2277ff6d7
), and everything seems to be working correctly.I've compared the generated LLVM IRs for an application I'm developing, and they are virtually identical:
enable()
:disable()
:The compiled binary seems to be working correctly on an Atmega328p, too.
Follow-ups
I've also got a similar set of changes to
avr-hal
, I'll try pushing the merge request in a few minutes :-)