From 0c7a0116a76c559e2bc0b2c0877e763f122a22fd Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 7 May 2018 17:46:26 +0200 Subject: [PATCH] more fixes --- Cargo.toml | 5 + ci/script.sh | 4 +- examples/periodic.rs | 4 +- examples/user-struct.rs | 56 ++++++++ macros/src/analyze.rs | 17 ++- macros/src/trans.rs | 183 ++++++++++++++++-------- src/tq.rs | 1 + tests/cfail.rs | 6 +- tests/cfail/critical-section.rs | 2 +- tests/cfail/duplicated-task.rs | 2 +- tests/cfail/exception.rs | 6 +- tests/cfail/idle.rs | 2 +- tests/cfail/init-resource-share-idle.rs | 2 +- tests/cfail/init-resource-share-task.rs | 2 +- tests/cfail/init.rs | 7 +- tests/cfail/interrupt.rs | 2 +- tests/cfail/late-resource-init.rs | 2 +- tests/cfail/lock.rs | 2 +- tests/cfail/priority-too-high.rs | 2 +- tests/cfail/priority-too-low.rs | 4 +- tests/cfail/resource-alias.rs | 2 +- tests/cfail/resource-not-send-sync.rs | 2 +- tests/cfail/token-outlive.rs | 2 +- tests/cfail/token-transfer.rs | 2 +- tests/cfail/wrong-threshold.rs | 2 +- 25 files changed, 227 insertions(+), 94 deletions(-) create mode 100644 examples/user-struct.rs diff --git a/Cargo.toml b/Cargo.toml index 57432690c3..90c70a6072 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,10 @@ required-features = ["timer-queue"] name = "periodic" required-features = ["timer-queue"] +[[example]] +name = "user-struct" +required-features = ["timer-queue"] + [dependencies] cortex-m = "0.4.0" cortex-m-rtfm-macros = { path = "macros", version = "0.3.1" } @@ -60,6 +64,7 @@ compiletest_rs = "0.3.5" [dev-dependencies] panic-abort = "0.1.1" +panic-itm = "0.1.0" typenum = "1.10.0" [dev-dependencies.stm32f103xx] diff --git a/ci/script.sh b/ci/script.sh index 58a0784a8d..1e0585a741 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -2,8 +2,8 @@ set -euxo pipefail main() { if [ $TARGET = x86_64-unknown-linux-gnu ]; then - cargo build - cargo test --test cfail + cargo build --target $TARGET + cargo test --test cfail --target $TARGET return fi diff --git a/examples/periodic.rs b/examples/periodic.rs index ae63afa0a9..ee30a5bab5 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -52,7 +52,7 @@ app! { }, init: { - async_after: [a], + async: [a], }, free_interrupts: [EXTI0], @@ -72,7 +72,7 @@ const S: u32 = 1_000 * MS; fn init(mut ctxt: init::Context) -> init::LateResources { iprintln!(&mut ctxt.core.ITM.stim[0], "init"); - ctxt.async.a.post(&mut ctxt.threshold, 1 * S, ()).ok(); + ctxt.async.a.post(&mut ctxt.threshold, ()).ok(); init::LateResources { ITM: ctxt.core.ITM } } diff --git a/examples/user-struct.rs b/examples/user-struct.rs new file mode 100644 index 0000000000..0ac49348db --- /dev/null +++ b/examples/user-struct.rs @@ -0,0 +1,56 @@ +#![deny(unsafe_code)] +#![deny(warnings)] +#![feature(proc_macro)] +#![no_std] + +extern crate cortex_m; +extern crate cortex_m_rtfm as rtfm; +extern crate panic_abort; +extern crate stm32f103xx; + +use cortex_m::asm; +use rtfm::app; + +pub struct Foo(u32); + +app! { + device: stm32f103xx, + + resources: { + static FOO: Foo = Foo(0); + static BAR: Foo; + }, + + free_interrupts: [EXTI0], + + init: { + async: [a], + async_after: [b], + }, + + tasks: { + a: { + input: Foo, + }, + + b: { + input: Foo, + }, + }, +} + +#[inline(always)] +fn init(_ctxt: init::Context) -> init::LateResources { + init::LateResources { BAR: Foo(0) } +} + +#[inline(always)] +fn idle(_ctxt: idle::Context) -> ! { + loop { + asm::wfi(); + } +} + +fn a(_ctxt: a::Context) {} + +fn b(_ctxt: b::Context) {} diff --git a/macros/src/analyze.rs b/macros/src/analyze.rs index 3154b36aa1..46dbea6e7d 100644 --- a/macros/src/analyze.rs +++ b/macros/src/analyze.rs @@ -14,7 +14,16 @@ pub fn app(app: &App) -> Context { let mut free_interrupts = app.free_interrupts.iter().cloned().collect::>(); async.extend(&app.init.async); - async_after.extend(&app.init.async_after); + + for task in &app.init.async_after { + async_after.insert(*task); + + // Timer queue + if let Entry::Vacant(entry) = tq.tasks.entry(*task) { + tq.capacity += app.tasks[task].interrupt_or_capacity.right().unwrap(); + entry.insert(app.tasks[task].priority); + } + } // compute dispatchers for (name, task) in &app.tasks { @@ -23,9 +32,9 @@ pub fn app(app: &App) -> Context { triggers.insert(interrupt, (*name, task.priority)); } Either::Right(capacity) => { - let dispatcher = dispatchers.entry(task.priority).or_insert(Dispatcher::new( - free_interrupts.pop().expect("not enough free interrupts"), - )); + let dispatcher = dispatchers.entry(task.priority).or_insert_with(|| { + Dispatcher::new(free_interrupts.pop().expect("not enough free interrupts")) + }); dispatcher.tasks.push(*name); dispatcher.capacity += capacity; } diff --git a/macros/src/trans.rs b/macros/src/trans.rs index 822540f38b..c4f7c3c390 100644 --- a/macros/src/trans.rs +++ b/macros/src/trans.rs @@ -274,7 +274,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { #[allow(unsafe_code)] #[export_name = #export_name] pub unsafe extern "C" fn #fn_name() { - let _ = #device::Interrupt::#interrupt; // verify that the interrupt exists + use #device::Interrupt; + let _ = Interrupt::#interrupt; // verify that the interrupt exists #name::HANDLER(#name::Context::new(#bl ())) } }); @@ -306,13 +307,24 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { ctxt.ceilings.slot_queues().get(name).cloned() // 0 = owned by init .unwrap_or(0) )); - mod_.push(quote! { + + let mangled = Ident::from(format!("_ZN{}{}6BUFFERE", name.as_ref().len(), name)); + + // NOTE must be in the root because of `#input` + root.push(quote! { + #[allow(non_upper_case_globals)] #[allow(unsafe_code)] - pub static mut BUFFER: [#krate::Node<#input>; #capacity] = - unsafe { #krate::uninitialized() }; + pub static mut #mangled: [#hidden::#krate::Node<#input>; #capacity] = + unsafe { #hidden::#krate::uninitialized() }; + + }); + + mod_.push(quote! { + pub use ::#mangled as BUFFER; pub struct SQ { _0: () } + #[allow(dead_code)] #[allow(unsafe_code)] impl SQ { pub unsafe fn new() -> Self { @@ -351,44 +363,40 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { let qc = Ident::from(format!("U{}", ctxt.ceilings.dispatch_queues()[&priority])); if cfg!(feature = "timer-queue") { - quote! { - #[allow(non_camel_case_types)] - pub struct #name { baseline: #krate::Instant } - + root.push(quote! { + #[allow(dead_code)] #[allow(unsafe_code)] - impl #name { - pub unsafe fn new(bl: #krate::Instant) -> Self { - #name { baseline: bl } - } - - // XXX or take `self`? + impl __async::#name { #[inline] pub fn post

( &mut self, - t: &mut #krate::Threshold

, + t: &mut #hidden::#krate::Threshold

, payload: #ty, ) -> Result<(), #ty> where - P: #krate::Unsigned + - #krate::Max<#krate::#sqc> + - #krate::Max<#krate::#qc>, - #krate::Maximum: #krate::Unsigned, - #krate::Maximum: #krate::Unsigned, + P: #hidden::#krate::Unsigned + + #hidden::#krate::Max<#hidden::#krate::#sqc> + + #hidden::#krate::Max<#hidden::#krate::#qc>, + #hidden::#krate::Maximum: #hidden::#krate::Unsigned, + #hidden::#krate::Maximum: #hidden::#krate::Unsigned, { unsafe { + use #hidden::#krate::Resource; + let slot = ::#name::SQ::new().claim_mut(t, |sq, _| sq.dequeue()); if let Some(index) = slot { let task = ::#__priority::Task::#name; core::ptr::write( - ::#name::BUFFER.get_unchecked_mut(index as usize), - #krate::Node { baseline: self.baseline, payload } + #name::BUFFER.get_unchecked_mut(index as usize), + #hidden::#krate::Node { baseline: self.baseline(), payload } ); - ::#__priority::Q::new().claim_mut(t, |q, _| { + #__priority::Q::new().claim_mut(t, |q, _| { q.split().0.enqueue_unchecked((task, index)); }); - #krate::set_pending(#device::Interrupt::#interrupt); + use #device::Interrupt; + #hidden::#krate::set_pending(Interrupt::#interrupt); Ok(()) } else { @@ -397,46 +405,59 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { } } } - } - } else { + }); + quote! { #[allow(non_camel_case_types)] - pub struct #name {} + pub struct #name { baseline: #krate::Instant } + #[allow(dead_code)] #[allow(unsafe_code)] impl #name { - pub unsafe fn new() -> Self { - #name {} + pub unsafe fn new(bl: #krate::Instant) -> Self { + #name { baseline: bl } } - // XXX or take `self`? + pub fn baseline(&self) -> #krate::Instant { + self.baseline + } + } + } + } else { + root.push(quote! { + #[allow(dead_code)] + #[allow(unsafe_code)] + impl __async::#name { #[inline] pub fn post

( &mut self, - t: &mut #krate::Threshold

, + t: &mut #hidden::#krate::Threshold

, payload: #ty, ) -> Result<(), #ty> where - P: #krate::Unsigned + - #krate::Max<#krate::#sqc> + - #krate::Max<#krate::#qc>, - #krate::Maximum: #krate::Unsigned, - #krate::Maximum: #krate::Unsigned, + P: #hidden::#krate::Unsigned + + #hidden::#krate::Max<#hidden::#krate::#sqc> + + #hidden::#krate::Max<#hidden::#krate::#qc>, + #hidden::#krate::Maximum: #hidden::#krate::Unsigned, + #hidden::#krate::Maximum: #hidden::#krate::Unsigned, { unsafe { + use #hidden::#krate::Resource; + if let Some(index) = ::#name::SQ::new().claim_mut(t, |sq, _| sq.dequeue()) { let task = ::#__priority::Task::#name; core::ptr::write( ::#name::BUFFER.get_unchecked_mut(index as usize), - #krate::Node { payload } + #hidden::#krate::Node { payload } ); ::#__priority::Q::new().claim_mut(t, |q, _| { q.split().0.enqueue_unchecked((task, index)); }); - #krate::set_pending(#device::Interrupt::#interrupt); + use #device::Interrupt; + #hidden::#krate::set_pending(Interrupt::#interrupt); Ok(()) } else { @@ -445,6 +466,19 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { } } } + }); + + quote! { + #[allow(non_camel_case_types)] + pub struct #name {} + + #[allow(dead_code)] + #[allow(unsafe_code)] + impl #name { + pub unsafe fn new() -> Self { + #name {} + } + } } } }) @@ -467,44 +501,43 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { let task = &app.tasks[name]; let ty = &task.input; - let sqc = Ident::from(format!("U{}", ctxt.ceilings.slot_queues()[name])); + let sqc = Ident::from(format!( + "U{}", + ctxt.ceilings.slot_queues().get(name).unwrap_or(&0) // 0 = owned by init + )); let tqc = Ident::from(format!("U{}", ctxt.ceilings.timer_queue())); - quote! { - #[allow(non_camel_case_types)] - pub struct #name { baseline: #krate::Instant } - + // NOTE needs to be in the root because of `#ty` + root.push(quote! { + #[allow(dead_code)] #[allow(unsafe_code)] - impl #name { - pub unsafe fn new(bl: #krate::Instant) -> Self { - #name { baseline: bl } - } - - // XXX or take `self`? + impl __async_after::#name { #[inline] pub fn post

( &self, - t: &mut #krate::Threshold

, + t: &mut #hidden::#krate::Threshold

, after: u32, payload: #ty, ) -> Result<(), #ty> where - P: #krate::Unsigned + - #krate::Max<#krate::#sqc> + - #krate::Max<#krate::#tqc>, - #krate::Maximum: #krate::Unsigned, - #krate::Maximum: #krate::Unsigned, + P: #hidden::#krate::Unsigned + + #hidden::#krate::Max<#hidden::#krate::#sqc> + + #hidden::#krate::Max<#hidden::#krate::#tqc>, + #hidden::#krate::Maximum: #hidden::#krate::Unsigned, + #hidden::#krate::Maximum: #hidden::#krate::Unsigned, { unsafe { + use #hidden::#krate::Resource; + if let Some(index) = ::#name::SQ::new().claim_mut(t, |sq, _| sq.dequeue()) { - let bl = self.baseline + after; + let bl = self.baseline() + after; let task = ::__tq::Task::#name; core::ptr::write( ::#name::BUFFER.get_unchecked_mut(index as usize), - #krate::Node { baseline: bl, payload }, + #hidden::#krate::Node { baseline: bl, payload }, ); - let m = #krate::Message { + let m = #hidden::#krate::Message { baseline: bl, index, task, @@ -519,6 +552,23 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { } } } + }); + + quote! { + #[allow(non_camel_case_types)] + pub struct #name { baseline: #krate::Instant } + + #[allow(dead_code)] + #[allow(unsafe_code)] + impl #name { + pub unsafe fn new(bl: #krate::Instant) -> Self { + #name { baseline: bl } + } + + pub fn baseline(&self) -> #krate::Instant { + self.baseline + } + } } }) .collect::>(); @@ -549,7 +599,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { #__priority::Q::new().claim_mut(t, |q, _| { q.split().0.enqueue_unchecked((#__priority::Task::#name, index)) }); - #hidden::#krate::set_pending(#device::Interrupt::#interrupt); + use #device::Interrupt; + #hidden::#krate::set_pending(Interrupt::#interrupt); } } }) @@ -588,6 +639,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { pub type Priority = #krate::#priority; #[allow(non_camel_case_types)] + #[allow(dead_code)] #[derive(Clone, Copy)] pub enum Task { #(#tasks,)* } } @@ -646,6 +698,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { } #[allow(non_camel_case_types)] + #[allow(dead_code)] #[derive(Clone, Copy)] pub enum Task { #(#tasks,)* } } @@ -819,6 +872,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { pub use ::#device::Peripherals as Device; pub use ::_ZN4init13LateResourcesE as LateResources; + #[allow(dead_code)] pub struct Context { pub async: Async, #baseline_field @@ -890,7 +944,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { let interrupt = dispatcher.interrupt(); post_init.push(quote! { let priority = ((1 << #prio_bits) - #priority) << (8 - #prio_bits); - _nvic.set_priority(#device::Interrupt::#interrupt, priority); + _nvic.set_priority(Interrupt::#interrupt, priority); }); } @@ -898,7 +952,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { for (interrupt, (_, priority)) in &ctxt.triggers { post_init.push(quote! { let priority = ((1 << #prio_bits) - #priority) << (8 - #prio_bits); - _nvic.set_priority(#device::Interrupt::#interrupt, priority); + _nvic.set_priority(Interrupt::#interrupt, priority); }); } @@ -906,14 +960,14 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { for dispatcher in ctxt.dispatchers.values() { let interrupt = dispatcher.interrupt(); post_init.push(quote! { - _nvic.enable(#device::Interrupt::#interrupt); + _nvic.enable(Interrupt::#interrupt); }); } // Enable triggers for interrupt in ctxt.triggers.keys() { post_init.push(quote! { - _nvic.enable(#device::Interrupt::#interrupt); + _nvic.enable(Interrupt::#interrupt); }); } @@ -951,6 +1005,7 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { #[allow(unused_imports)] use self::#krate::Resource; + #[allow(dead_code)] pub struct Context { pub resources: Resources, pub threshold: #krate::Threshold<#krate::U0>, @@ -991,6 +1046,8 @@ pub fn app(ctxt: &Context, app: &App) -> Tokens { fn main() { #[allow(unused_imports)] use #hidden::#krate::Resource; + #[allow(unused_imports)] + use #device::Interrupt; #[allow(unused_mut)] unsafe { diff --git a/src/tq.rs b/src/tq.rs index fc7420829c..19412fe961 100644 --- a/src/tq.rs +++ b/src/tq.rs @@ -99,6 +99,7 @@ where Some((m.task, m.index)) } else { + // set a new timeout const MAX: u32 = 0x00ffffff; tq.syst.set_reload(cmp::min(MAX, diff as u32)); diff --git a/tests/cfail.rs b/tests/cfail.rs index 6572d6576b..fdfbf7e6f2 100644 --- a/tests/cfail.rs +++ b/tests/cfail.rs @@ -10,8 +10,12 @@ fn cfail() { let mut config = Config::default(); config.mode = Mode::CompileFail; config.src_base = PathBuf::from(format!("tests/cfail")); + config.target = "x86_64-unknown-linux-gnu".to_owned(); config.target_rustcflags = - Some("-C panic=abort -L target/debug -L target/debug/deps ".to_string()); + Some("-C panic=abort \ + -L target/debug/deps \ + -L target/x86_64-unknown-linux-gnu/debug \ + -L target/x86_64-unknown-linux-gnu/debug/deps ".to_string()); compiletest::run_tests(&config); } diff --git a/tests/cfail/critical-section.rs b/tests/cfail/critical-section.rs index a055de4af9..45cc4114cd 100644 --- a/tests/cfail/critical-section.rs +++ b/tests/cfail/critical-section.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::{app, Resource}; diff --git a/tests/cfail/duplicated-task.rs b/tests/cfail/duplicated-task.rs index b2f2c69149..92d7afda12 100644 --- a/tests/cfail/duplicated-task.rs +++ b/tests/cfail/duplicated-task.rs @@ -14,7 +14,7 @@ app! { //~ error proc macro panicked tasks: { a: { interrupt: EXTI0, //~ error this interrupt is already bound to another task - priority: 1, + // priority: 1, }, b: { diff --git a/tests/cfail/exception.rs b/tests/cfail/exception.rs index 7e5a3ef36f..4e27205069 100644 --- a/tests/cfail/exception.rs +++ b/tests/cfail/exception.rs @@ -4,13 +4,13 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; -app! { //~ error proc macro panicked - device: stm32f103xx, //~ no variant named `SYS_TICK` found for type `stm32f103xx::Interrupt` +app! { //~ no variant named `SYS_TICK` found for type `stm32f103xx::Interrupt` + device: stm32f103xx, tasks: { sys_tick: { diff --git a/tests/cfail/idle.rs b/tests/cfail/idle.rs index 6dde1a6364..4011bd2e54 100644 --- a/tests/cfail/idle.rs +++ b/tests/cfail/idle.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/init-resource-share-idle.rs b/tests/cfail/init-resource-share-idle.rs index 476f519f84..811eea77ae 100644 --- a/tests/cfail/init-resource-share-idle.rs +++ b/tests/cfail/init-resource-share-idle.rs @@ -3,7 +3,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/init-resource-share-task.rs b/tests/cfail/init-resource-share-task.rs index 0a86478d7f..c5730d5aeb 100644 --- a/tests/cfail/init-resource-share-task.rs +++ b/tests/cfail/init-resource-share-task.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/init.rs b/tests/cfail/init.rs index f59417a6f3..d195049d79 100644 --- a/tests/cfail/init.rs +++ b/tests/cfail/init.rs @@ -4,13 +4,14 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; -app! { //~ error incorrect number of function parameters - //~^ note expected type `fn(init::Context) -> _ZN4init13LateResourcesE` +app! { //~ error mismatched types + //~^ incorrect number of function parameters + //~| note expected type `fn(init::Context) -> _ZN4init13LateResourcesE` device: stm32f103xx, } diff --git a/tests/cfail/interrupt.rs b/tests/cfail/interrupt.rs index bb9014864a..3df3ffe073 100644 --- a/tests/cfail/interrupt.rs +++ b/tests/cfail/interrupt.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/late-resource-init.rs b/tests/cfail/late-resource-init.rs index 53a5caefc7..df2dcff053 100644 --- a/tests/cfail/late-resource-init.rs +++ b/tests/cfail/late-resource-init.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/lock.rs b/tests/cfail/lock.rs index 367c3af986..1a650bd412 100644 --- a/tests/cfail/lock.rs +++ b/tests/cfail/lock.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::{app, Resource}; diff --git a/tests/cfail/priority-too-high.rs b/tests/cfail/priority-too-high.rs index 6453890b28..bab21ecfd2 100644 --- a/tests/cfail/priority-too-high.rs +++ b/tests/cfail/priority-too-high.rs @@ -2,7 +2,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/priority-too-low.rs b/tests/cfail/priority-too-low.rs index 8cf9b80247..7010ff2452 100644 --- a/tests/cfail/priority-too-low.rs +++ b/tests/cfail/priority-too-low.rs @@ -4,12 +4,12 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; -app! { +app! { //~ error proc macro panicked device: stm32f103xx, tasks: { diff --git a/tests/cfail/resource-alias.rs b/tests/cfail/resource-alias.rs index b338070a95..84aaea4e1d 100644 --- a/tests/cfail/resource-alias.rs +++ b/tests/cfail/resource-alias.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/resource-not-send-sync.rs b/tests/cfail/resource-not-send-sync.rs index 9ed9b4e579..bb3c9859eb 100644 --- a/tests/cfail/resource-not-send-sync.rs +++ b/tests/cfail/resource-not-send-sync.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::app; diff --git a/tests/cfail/token-outlive.rs b/tests/cfail/token-outlive.rs index 691e7d2ed3..f354594f4c 100644 --- a/tests/cfail/token-outlive.rs +++ b/tests/cfail/token-outlive.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::{app, Resource}; diff --git a/tests/cfail/token-transfer.rs b/tests/cfail/token-transfer.rs index 3890997f0f..92e5d89164 100644 --- a/tests/cfail/token-transfer.rs +++ b/tests/cfail/token-transfer.rs @@ -5,7 +5,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; extern crate typenum; diff --git a/tests/cfail/wrong-threshold.rs b/tests/cfail/wrong-threshold.rs index c1b52f51a8..2346e5fecb 100644 --- a/tests/cfail/wrong-threshold.rs +++ b/tests/cfail/wrong-threshold.rs @@ -4,7 +4,7 @@ #![no_std] extern crate cortex_m_rtfm as rtfm; -extern crate panic_abort; +extern crate panic_itm; extern crate stm32f103xx; use rtfm::{app, Resource};