From e5fd02bd1c13bec4cc2e170f382000737857fcfc Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 11 Apr 2017 22:01:09 -0500 Subject: make NVIC.set_priority and basepri::write unsafe --- src/peripheral/mod.rs | 2 +- src/register/basepri.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs index 1f9e147..d14d782 100644 --- a/src/peripheral/mod.rs +++ b/src/peripheral/mod.rs @@ -380,7 +380,7 @@ impl Nvic { /// /// NOTE See `get_priority` method for an explanation of how NVIC priorities /// work. - pub fn set_priority(&self, interrupt: I, prio: u8) + pub unsafe fn set_priority(&self, interrupt: I, prio: u8) where I: Nr, { diff --git a/src/register/basepri.rs b/src/register/basepri.rs index e9164c1..d5ec002 100644 --- a/src/register/basepri.rs +++ b/src/register/basepri.rs @@ -16,7 +16,7 @@ pub fn read() -> u8 { /// Writes to the CPU register #[inline(always)] -pub fn write(basepri: u8) { +pub unsafe fn write(basepri: u8) { unsafe { asm!("msr BASEPRI, $0" : -- cgit v1.2.3