mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
partial thumv6m-none-eabi support
This commit is contained in:
parent
6af1873922
commit
5d6847ab7b
2 changed files with 12 additions and 1 deletions
6
build.rs
6
build.rs
|
@ -10,6 +10,12 @@ use std::path::PathBuf;
|
||||||
use syn::{Ident, IntTy, Lit};
|
use syn::{Ident, IntTy, Lit};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let target = env::var("TARGET").unwrap();
|
||||||
|
|
||||||
|
if target.starts_with("thumbv6m") {
|
||||||
|
println!("cargo:rustc-cfg=thumbv6m");
|
||||||
|
}
|
||||||
|
|
||||||
let bits = if env::var_os("CARGO_FEATURE_P2").is_some() {
|
let bits = if env::var_os("CARGO_FEATURE_P2").is_some() {
|
||||||
2
|
2
|
||||||
} else if env::var_os("CARGO_FEATURE_P3").is_some() {
|
} else if env::var_os("CARGO_FEATURE_P3").is_some() {
|
||||||
|
|
|
@ -10,8 +10,11 @@ use core::marker::PhantomData;
|
||||||
use core::cell::UnsafeCell;
|
use core::cell::UnsafeCell;
|
||||||
|
|
||||||
use cortex_m::interrupt::Nr;
|
use cortex_m::interrupt::Nr;
|
||||||
|
#[cfg(not(thumbv6m))]
|
||||||
use cortex_m::register::{basepri, basepri_max};
|
use cortex_m::register::{basepri, basepri_max};
|
||||||
use typenum::{Cmp, Equal, Greater, Less, Unsigned};
|
use typenum::{Cmp, Equal, Unsigned};
|
||||||
|
#[cfg(not(thumbv6m))]
|
||||||
|
use typenum::{Greater, Less};
|
||||||
|
|
||||||
pub use cortex_m::ctxt::{Context, Local};
|
pub use cortex_m::ctxt::{Context, Local};
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
|
@ -85,6 +88,7 @@ where
|
||||||
/// For the duration of the critical section, tasks whose priority level is
|
/// For the duration of the critical section, tasks whose priority level is
|
||||||
/// smaller than or equal to the resource `CEILING` will be prevented from
|
/// smaller than or equal to the resource `CEILING` will be prevented from
|
||||||
/// preempting the current task.
|
/// preempting the current task.
|
||||||
|
#[cfg(not(thumbv6m))]
|
||||||
pub fn lock<R, PRIORITY, F>(
|
pub fn lock<R, PRIORITY, F>(
|
||||||
&'static self,
|
&'static self,
|
||||||
_priority: &P<PRIORITY>,
|
_priority: &P<PRIORITY>,
|
||||||
|
@ -176,6 +180,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// See [Resource.lock](./struct.Resource.html#method.lock)
|
/// See [Resource.lock](./struct.Resource.html#method.lock)
|
||||||
|
#[cfg(not(thumbv6m))]
|
||||||
pub fn lock<R, PRIORITY, F>(
|
pub fn lock<R, PRIORITY, F>(
|
||||||
&'static self,
|
&'static self,
|
||||||
_priority: &P<PRIORITY>,
|
_priority: &P<PRIORITY>,
|
||||||
|
|
Loading…
Reference in a new issue