aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml5
-rw-r--r--ci/script.sh4
-rw-r--r--examples/periodic.rs4
-rw-r--r--examples/user-struct.rs56
-rw-r--r--macros/src/analyze.rs17
-rw-r--r--macros/src/trans.rs183
-rw-r--r--src/tq.rs1
-rw-r--r--tests/cfail.rs6
-rw-r--r--tests/cfail/critical-section.rs2
-rw-r--r--tests/cfail/duplicated-task.rs2
-rw-r--r--tests/cfail/exception.rs6
-rw-r--r--tests/cfail/idle.rs2
-rw-r--r--tests/cfail/init-resource-share-idle.rs2
-rw-r--r--tests/cfail/init-resource-share-task.rs2
-rw-r--r--tests/cfail/init.rs7
-rw-r--r--tests/cfail/interrupt.rs2
-rw-r--r--tests/cfail/late-resource-init.rs2
-rw-r--r--tests/cfail/lock.rs2
-rw-r--r--tests/cfail/priority-too-high.rs2
-rw-r--r--tests/cfail/priority-too-low.rs4
-rw-r--r--tests/cfail/resource-alias.rs2
-rw-r--r--tests/cfail/resource-not-send-sync.rs2
-rw-r--r--tests/cfail/token-outlive.rs2
-rw-r--r--tests/cfail/token-transfer.rs2
-rw-r--r--tests/cfail/wrong-threshold.rs2
25 files changed, 227 insertions, 94 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 57432690..90c70a60 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 58a0784a..1e0585a7 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 ae63afa0..ee30a5ba 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 00000000..0ac49348
--- /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 3154b36a..46dbea6e 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::<Vec<_>>();
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 822540f3..c4f7c3c3 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<P>(
&mut self,
- t: &mut #krate::Threshold<P>,
+ t: &mut #hidden::#krate::Threshold<P>,
payload: #ty,
) -> Result<(), #ty>
where
- P: #krate::Unsigned +
- #krate::Max<#krate::#sqc> +
- #krate::Max<#krate::#qc>,
- #krate::Maximum<P, #krate::#sqc>: #krate::Unsigned,
- #krate::Maximum<P, #krate::#qc>: #krate::Unsigned,
+ P: #hidden::#krate::Unsigned +
+ #hidden::#krate::Max<#hidden::#krate::#sqc> +
+ #hidden::#krate::Max<#hidden::#krate::#qc>,
+ #hidden::#krate::Maximum<P, #hidden::#krate::#sqc>: #hidden::#krate::Unsigned,
+ #hidden::#krate::Maximum<P, #hidden::#krate::#qc>: #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<P>(
&mut self,
- t: &mut #krate::Threshold<P>,
+ t: &mut #hidden::#krate::Threshold<P>,
payload: #ty,
) -> Result<(), #ty>
where
- P: #krate::Unsigned +
- #krate::Max<#krate::#sqc> +
- #krate::Max<#krate::#qc>,
- #krate::Maximum<P, #krate::#sqc>: #krate::Unsigned,
- #krate::Maximum<P, #krate::#qc>: #krate::Unsigned,
+ P: #hidden::#krate::Unsigned +
+ #hidden::#krate::Max<#hidden::#krate::#sqc> +
+ #hidden::#krate::Max<#hidden::#krate::#qc>,
+ #hidden::#krate::Maximum<P, #hidden::#krate::#sqc>: #hidden::#krate::Unsigned,
+ #hidden::#krate::Maximum<P, #hidden::#krate::#qc>: #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<P>(
&self,
- t: &mut #krate::Threshold<P>,
+ t: &mut #hidden::#krate::Threshold<P>,
after: u32,
payload: #ty,
) -> Result<(), #ty>
where
- P: #krate::Unsigned +
- #krate::Max<#krate::#sqc> +
- #krate::Max<#krate::#tqc>,
- #krate::Maximum<P, #krate::#sqc>: #krate::Unsigned,
- #krate::Maximum<P, #krate::#tqc>: #krate::Unsigned,
+ P: #hidden::#krate::Unsigned +
+ #hidden::#krate::Max<#hidden::#krate::#sqc> +
+ #hidden::#krate::Max<#hidden::#krate::#tqc>,
+ #hidden::#krate::Maximum<P, #hidden::#krate::#sqc>: #hidden::#krate::Unsigned,
+ #hidden::#krate::Maximum<P, #hidden::#krate::#tqc>: #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::<Vec<_>>();
@@ -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 fc742082..19412fe9 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 6572d657..fdfbf7e6 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 a055de4a..45cc4114 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 b2f2c691..92d7afda 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 7e5a3ef3..4e272050 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 6dde1a63..4011bd2e 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 476f519f..811eea77 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 0a86478d..c5730d5a 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 f59417a6..d195049d 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 bb901486..3df3ffe0 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 53a5caef..df2dcff0 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 367c3af9..1a650bd4 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 6453890b..bab21ecf 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 8cf9b802..7010ff24 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 b338070a..84aaea4e 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 9ed9b4e5..bb3c9859 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 691e7d2e..f354594f 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 3890997f..92e5d891 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 c1b52f51..2346e5fe 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};