avr-rust / delay

arduino-like delay routines based on busy-wait loops
Apache License 2.0
15 stars 11 forks source link

Mark llvm_asm calls as volatile #13

Closed Yarn closed 2 years ago

Yarn commented 3 years ago

I'm pretty sure the llvm_asm invocation should be marked as volatile like

unsafe {llvm_asm!("1: sbiw $0,1
   brne 1b"
   :
   : "w" (0)
   :
   : "volatile")}

This could potentially explain https://github.com/avr-rust/delay/issues/11 and https://github.com/avr-rust/blink/issues/34 but I don't have an AVR device set up to test with.

stappersg commented 2 years ago

llvm_asm!() has been replaced with asm!().