~ruther/avr-device

ref: 6ab6f94a2f0089f43b4d274d93493a3a6c0233be avr-device/src/interrupt.rs -rw-r--r-- 2.9 KiB
6ab6f94a — Michael Buesch 2 years ago
Add basic documentation for beginners
91d0ad81 — Patryk Wychowaniec 3 years ago
Add support for `asm!()`
bbba9867 — Tray Torrance 3 years ago
Return the previous interrupt status upon disabling interrupts

This commit addresses #88 by returning a boolean which reflects the
previous state of the GIE flag upon disabling interrupts. This allows
`critical-section` to implement itself for AVR, while not breaking the
existing `avr-device` API.
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 6 years ago
Add interrupts and use cfg-if

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