Only emit inline-assembly when building for AVR
Make sure that we'll never emit AVR assembly on non-AVR targets.
Instead of failing the build, fail at runtime, to allow a potential
application testsuite to run even if those functions somehow get linked
in.
Signed-off-by: Rahix <rahix@rahix.de>
interrupt: Fix interrupt::free() reading wrong address
The SREG is at IO address 0x3F, not 0x35. Fix interrupt::free() to read
the correct register to make it work as advertised.
Signed-off-by: Rahix <rahix@rahix.de>
interrupt: Make interrupt::enable() unsafe
To bring this crate more in line with cortex-m, mark interrupt::enable()
as unsafe. This also fixes a soundness issue: When the function is
safe, one could call it inside a critical section in entirely safe rust.
This is problematic because lot's of code in critical sections relies on
the fact that interrupts are disabled and it thus can safely perform
non-atomic operations without anything interrupting it.
Signed-off-by: Rahix <rahix@rahix.de>
Use llvm_asm!() instead of asm!()
The asm!() feature was changed to a new syntax which this project did not yet
adopt. The old asm!() is now available as llvm_asm!(). Switch to that to
support nightly build.
See PR #27 for details.
Switch to a new design as outlined in #17
Signed-off-by: Rahix <rahix@rahix.de>