diff options
| author | homunkulus <homunkulus@gmx.com> | 2018-01-15 22:34:09 +0000 |
|---|---|---|
| committer | homunkulus <homunkulus@gmx.com> | 2018-01-15 22:34:09 +0000 |
| commit | b73263e8fa534233e8c097c6b1e6e430ea160d13 (patch) | |
| tree | c82e6f193e0bf9b842366e305056481d4d1666b2 /src/examples | |
| parent | 34edc41e9289e83468f68663a7f4a7f0f6cc2797 (diff) | |
| parent | def4fc8079dcb646ef3cab446a4b160e09e169bf (diff) | |
Auto merge of #64 - japaric:v3, r=japaric
v0.3.0
None
Diffstat (limited to 'src/examples')
| -rw-r--r-- | src/examples/_6_safe_static_mut_ref.rs | 36 | ||||
| -rw-r--r-- | src/examples/_7_generics.rs (renamed from src/examples/_6_generics.rs) | 0 | ||||
| -rw-r--r-- | src/examples/_8_full_syntax.rs (renamed from src/examples/_7_full_syntax.rs) | 0 | ||||
| -rw-r--r-- | src/examples/mod.rs | 5 |
4 files changed, 39 insertions, 2 deletions
diff --git a/src/examples/_6_safe_static_mut_ref.rs b/src/examples/_6_safe_static_mut_ref.rs new file mode 100644 index 0000000..32eb3d9 --- /dev/null +++ b/src/examples/_6_safe_static_mut_ref.rs @@ -0,0 +1,36 @@ +//! Safe creation of `&'static mut` references +//! +//! ``` +//! #![deny(unsafe_code)] +//! #![deny(warnings)] +//! #![feature(proc_macro)] +//! #![no_std] +//! +//! extern crate cortex_m_rtfm as rtfm; +//! extern crate stm32f103xx; +//! +//! use rtfm::app; +//! +//! app! { +//! device: stm32f103xx, +//! +//! resources: { +//! static BUFFER: [u8; 16] = [0; 16]; +//! }, +//! +//! init: { +//! resources: [BUFFER], +//! }, +//! } +//! +//! fn init(_p: init::Peripherals, r: init::Resources) { +//! let _buf: &'static mut [u8; 16] = r.BUFFER; +//! } +//! +//! fn idle() -> ! { +//! loop { +//! rtfm::wfi(); +//! } +//! } +//! ``` +// Auto-generated. Do not modify. diff --git a/src/examples/_6_generics.rs b/src/examples/_7_generics.rs index 22bb777..22bb777 100644 --- a/src/examples/_6_generics.rs +++ b/src/examples/_7_generics.rs diff --git a/src/examples/_7_full_syntax.rs b/src/examples/_8_full_syntax.rs index f8db408..f8db408 100644 --- a/src/examples/_7_full_syntax.rs +++ b/src/examples/_8_full_syntax.rs diff --git a/src/examples/mod.rs b/src/examples/mod.rs index 53e74ed..64d1e2e 100644 --- a/src/examples/mod.rs +++ b/src/examples/mod.rs @@ -6,5 +6,6 @@ pub mod _2_two_tasks; pub mod _3_preemption; pub mod _4_nested; pub mod _5_late_resources; -pub mod _6_generics; -pub mod _7_full_syntax; +pub mod _6_safe_static_mut_ref; +pub mod _7_generics; +pub mod _8_full_syntax; |
