~ruther/avr-device

ref: f7089edfb0e59c598184e1ad8f783995d7f15dec avr-device/src/interrupt.rs -rw-r--r-- 1.6 KiB
12879fde — Rahix 4 years ago
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>
706a5c26 — Rahix 4 years ago
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>
c0edb56c — Rahix 4 years ago
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>
c3144637 — Liam Perlaki 4 years ago
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.
dc45b3cc — Rahix 5 years ago
Switch to a new design as outlined in #17

Signed-off-by: Rahix <rahix@rahix.de>
4d71c0ee — Rahix 5 years ago
Add interrupts and use cfg-if

Signed-off-by: Rahix <rahix@rahix.de>
Do not follow this link