Cryptjar / avr-progmem-rs

Progmem utility for the AVR architecture
Apache License 2.0
28 stars 8 forks source link

convert from llvm_asm! to (I think) asm! #6

Closed mutantbob closed 2 years ago

mutantbob commented 2 years ago

The latest AVR template now uses channel = "nightly-2022-05-10". Unfortunately, that breaks any code that uses llvm_asm!

error: cannot find macro `llvm_asm` in this scope
  --> /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/avr-progmem-0.2.0/src/raw.rs:84:4
   |
84 |             llvm_asm!(
   |             ^^^^^^^^

I think the avr-hal crates use feature flags enabled by build.rs to support the new rust : https://github.com/Rahix/avr-hal/commit/5d757696e338104622a0f89c51020b718bf48b62

mutantbob commented 2 years ago

Good news.

I performed a little test by taking one of my apps and converting its "hello" to

let _ = uwriteln!(
    &mut serial,
    "{}",
    progmem_display!("do you wanna have a bad time?!")
);

and I tweaked the Cargo.toml with

[dependencies]
avr-progmem = "0.3.0-alpha"

[patch.crates-io]
avr-progmem = { git="https://github.com/Cryptjar/avr-progmem-rs.git", branch="v0.3"}

I compiled with nightly-2022-05-10 and flashed it to the Arduino. It displayed the message as I hoped.

I look forward to your updated crate being available on crates.io.

Cryptjar commented 2 years ago

Thanks for testing. I also updated the MSRV notice to reflect the compatibility with nightly-2022-05-10 (it needs to be still a nightly as AVR inline-assembly is still unstable for some reason). Sorry, for the brevity on my side, I'm a bit busy at the moment.

I just published it as v0.3.0 on crates.io, thus I'm closing this issue.