rust-embedded-community / embedded-nal

An Embedded Network Abstraction Layer
Apache License 2.0
177 stars 25 forks source link

AVR Applications using the embedded-nal crate fail to compile #74

Open mutantbob opened 2 years ago

mutantbob commented 2 years ago

If you create an AVR project using cargo generate --git https://github.com/Rahix/avr-hal-template.git and add a dependency on embedded-nal (v 0.6.0) compilation triggers an error

error: cannot find macro `llvm_asm` in this scope
   --> /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/critical-section-0.2.7/src/lib.rs:127:13
    |
127 |             llvm_asm!(
    |             ^^^^^^^^

This is because of a dependency chain heapless ^0.7 -> atomic-polyfill 0.1.8 -> critical-section 0.2.7

When heapless resolves https://github.com/japaric/heapless/issues/312 it should be possible for embedded-nal to upgrade its dependency and work on modern Rust AVR.