mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
bump cortex-m version to v0.3.1
barrier! is no longer needed
This commit is contained in:
parent
877a32448f
commit
6577f4a91a
2 changed files with 1 additions and 10 deletions
|
@ -13,7 +13,7 @@ repository = "https://github.com/japaric/cortex-m-rtfm"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
cortex-m = "0.3.0"
|
cortex-m = "0.3.1"
|
||||||
static-ref = "0.2.0"
|
static-ref = "0.2.0"
|
||||||
|
|
||||||
[dependencies.cortex-m-rtfm-macros]
|
[dependencies.cortex-m-rtfm-macros]
|
||||||
|
|
|
@ -19,13 +19,6 @@ use cortex_m::interrupt::Nr;
|
||||||
#[cfg(not(armv6m))]
|
#[cfg(not(armv6m))]
|
||||||
use cortex_m::register::{basepri_max, basepri};
|
use cortex_m::register::{basepri_max, basepri};
|
||||||
|
|
||||||
#[cfg(not(armv6m))]
|
|
||||||
macro_rules! barrier {
|
|
||||||
() => {
|
|
||||||
asm!("" ::: "memory" : "volatile");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
unsafe fn claim<T, U, R, F, G>(
|
unsafe fn claim<T, U, R, F, G>(
|
||||||
data: T,
|
data: T,
|
||||||
|
@ -54,9 +47,7 @@ where
|
||||||
let old = basepri::read();
|
let old = basepri::read();
|
||||||
let hw = (max_priority - ceiling) << (8 - nvic_prio_bits);
|
let hw = (max_priority - ceiling) << (8 - nvic_prio_bits);
|
||||||
basepri_max::write(hw);
|
basepri_max::write(hw);
|
||||||
barrier!();
|
|
||||||
let ret = f(g(data), &mut Threshold(ceiling));
|
let ret = f(g(data), &mut Threshold(ceiling));
|
||||||
barrier!();
|
|
||||||
basepri::write(old);
|
basepri::write(old);
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue