mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
Merge #373
373: Added `bare_metal::CriticalSection` to `init::Context` r=AfoHT a=korken89 Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
This commit is contained in:
commit
decd9112d8
4 changed files with 13 additions and 3 deletions
|
@ -60,6 +60,7 @@ cortex-m-rtic-macros = { path = "macros", version = "0.5.2" }
|
||||||
rtic-core = "0.3.0"
|
rtic-core = "0.3.0"
|
||||||
cortex-m-rt = "0.6.9"
|
cortex-m-rt = "0.6.9"
|
||||||
heapless = "0.5.0"
|
heapless = "0.5.0"
|
||||||
|
bare-metal = "1.0.0"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
version_check = "0.9"
|
version_check = "0.9"
|
||||||
|
|
|
@ -47,6 +47,14 @@ pub fn codegen(ctxt: Context, resources_tick: bool, app: &App, extra: &Extra) ->
|
||||||
values.push(quote!(device: #device::Peripherals::steal()));
|
values.push(quote!(device: #device::Peripherals::steal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lt = Some(quote!('a));
|
||||||
|
fields.push(quote!(
|
||||||
|
/// Critical section token for init
|
||||||
|
pub cs: rtic::export::CriticalSection<#lt>
|
||||||
|
));
|
||||||
|
|
||||||
|
values.push(quote!(cs: rtic::export::CriticalSection::new()));
|
||||||
|
|
||||||
values.push(quote!(core));
|
values.push(quote!(core));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ use core::{
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use crate::tq::{NotReady, TimerQueue};
|
pub use crate::tq::{NotReady, TimerQueue};
|
||||||
|
pub use bare_metal::CriticalSection;
|
||||||
#[cfg(armv7m)]
|
#[cfg(armv7m)]
|
||||||
pub use cortex_m::register::basepri;
|
pub use cortex_m::register::basepri;
|
||||||
pub use cortex_m::{
|
pub use cortex_m::{
|
||||||
|
|
|
@ -28,10 +28,10 @@ error[E0425]: cannot find value `FOO` in this scope
|
||||||
44 | FOO;
|
44 | FOO;
|
||||||
| ^^^ not found in this scope
|
| ^^^ not found in this scope
|
||||||
|
|
||||||
error: duplicate lang item in crate `panic_halt`: `panic_impl`.
|
error: duplicate lang item in crate `panic_semihosting`: `panic_impl`.
|
||||||
|
|
|
|
||||||
= note: first defined in crate `std`.
|
= note: first defined in crate `std`.
|
||||||
|
|
||||||
error: duplicate lang item in crate `panic_semihosting`: `panic_impl`.
|
error: duplicate lang item in crate `panic_halt`: `panic_impl`.
|
||||||
|
|
|
|
||||||
= note: first defined in crate `panic_halt`.
|
= note: first defined in crate `panic_semihosting`.
|
||||||
|
|
Loading…
Reference in a new issue